gcc/gcc/ipa-prop.c

5947 lines
171 KiB
C
Raw Normal View History

/* Interprocedural analyses.
Copyright (C) 2005-2017 Free Software Foundation, Inc.
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
Software Foundation; either version 3, or (at your option) any later
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
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "backend.h"
alias.c: Reorder #include statements and remove duplicates. 2015-10-29 Andrew MacLeod <amacleod@redhat.com> * alias.c: Reorder #include statements and remove duplicates. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-common.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-poly.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int-print.cc: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. From-SVN: r229526
2015-10-29 14:57:32 +01:00
#include "rtl.h"
genattrtab.c (write_header): Include hash-set.h... 2015-01-09 Michael Collison <michael.collison@linaro.org> * genattrtab.c (write_header): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-attrtab.c. * genautomata.c (main) : Include hash-set.h, macInclude hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-automata.c. * genemit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-emit.c. * gengtype.c (open_base_files): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating gtype-desc.c. * genopinit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-opinit.c. * genoutput.c (output_prologue): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-output.c. * genpeep.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-peep.c. * genpreds.c (write_insn_preds_c): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-preds.c. * optc-save-gen-awk: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating options-save.c. * opth-gen.awk: Change include guard from GCC_C_COMMON_H to GCC_C_COMMON_C when generating options.h. * ada/gcc-interface/cuintp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/decl.c: ditto. * ada/gcc-interface/misc.c: ditto. * ada/gcc-interface/targtyps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, real.h, fold-const.h, wide-int.h, inchash.h due to flattening of tree.h. * ada/gcc-interface/utils.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/utils2.c: ditto. * alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * asan.c: ditto. * attribs.c: ditto. * auto-inc-dec.c: ditto. * auto-profile.c: ditto * bb-reorder.c: ditto. * bt-load.c: Include symtab.h due to flattening of tree.h. * builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c/c-array-notation.c: ditto. * c/c-aux-info.c: ditto. * c/c-convert.c: ditto. * c/c-decl.c: ditto. * c/c-errors.c: ditto. * c/c-lang.c: dittoxs. * c/c-objc-common.c: ditto. * c/c-parser.c: ditto. * c/c-typeck.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * calls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ccmp.c: ditto. * c-family/array-notation-common.c: ditto. * c-family/c-ada-spec.c: ditto. * c-family/c-cilkplus.c: ditto. * c-family/c-common.c: Include input.h due to flattening of tree.h. Define macro GCC_C_COMMON_C. * c-family/c-common.h: Flatten tree.h header files into c-common.h. Remove include of tree-core.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: ditto. * c-family/c-format.c: Flatten tree.h header files into c-common.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-format.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * c-family/c-gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/cilk.c: ditto. * c-family/c-lex.c: ditto. * c-family/c-omp.c: ditto. * c-family/c-opts.c: ditto. * c-family/c-pch.c: ditto. * c-family/c-ppoutput.c: ditto. * c-family/c-pragma.c: ditto. * c-family/c-pretty-print.c: ditto. * c-family/c-semantics.c: ditto. * c-family/c-ubsan.c: ditto. * c-family/stub-objc.c: ditto. * cfgbuild.c: ditto. * cfg.c: ditto. * cfgcleanup.c: ditto. * cfgexpand.c: ditto. * cfghooks.c: ditto. * cfgloop.c: Include symtab.h, fold-const.h, and inchash.h due to flattening of tree.h. * cfgloopmanip.c: ditto. * cfgrtl.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * cgraphbuild.c: ditto. * cgraph.c: ditto. * cgraphclones.c: ditto. * cgraphunit.c: ditto. * cilk-common.c: ditto. * combine.c: ditto. * combine-stack-adj.c: Include symbol.h due to flattening of tree.h. * config/aarch64/aarch64-builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/aarch64/aarch64.c: ditto. * config/alpha/alpha.c: ditto. * config/arc/arc.c: ditto. * config/arm/aarch-common.c: ditto. * config/arm/arm-builtins.c: ditto. * config/arm/arm.c: ditto. * config/arm/arm-c.c: ditto. * config/avr/avr.c: ditto. * config/avr/avr-c.c: ditto. * config/avr/avr-log.c: ditto. * config/bfin/bfin.c: ditto. * config/c6x/c6x.c: ditto. * config/cr16/cr16.c: ditto. * config/cris/cris.c: ditto. * config/darwin.c: ditto. * config/darwin-c.c: ditto. * config/default-c.c: ditto. * config/epiphany/epiphany.c: ditto. * config/fr30/fr30.c: ditto. * config/frv/frv.c: ditto. * config/glibc-c.c: ditto. * config/h8300/h8300.c: ditto. * config/i386/i386.c: ditto. * config/i386/i386-c.c: ditto. * config/i386/msformat.c: ditto. * config/i386/winnt.c: ditto. * config/i386/winnt-cxx.c: ditto. * config/i386/winnt-stubs.c: ditto. * config/ia64/ia64.c: ditto. * config/ia64/ia64-c.c: ditto. * config/iq2000/iq2000.c: ditto. * config/lm32/lm32.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c-pragma.c: ditto. * config/m32c/m32cr.c: ditto. * config/m68/m68k.c: ditto. * config/mcore/mcore.c: ditto. * config/mep/mep.c: ditto. * config/mep/mep-pragma.c: ditto. * config/microblaze/microblaze.c: ditto. * config/microblaze/microblaze-c.c: ditto. * config/mips/mips.c: ditto. * config/mmix/mmix.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/mn10300/mn10300.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/moxie/moxie.c: ditto. * config/msp430/msp430.c: ditto. * config/msp430/msp430-c.c: ditto. * config/nds32/nds32.c: ditto. * config/nds32/nds32-cost.c: ditto. * config/nds32/nds32-fp-as-gp.c: ditto. * config/nds32/nds32-intrinsic.c: ditto. * config/nds32/nds32-isr.c: ditto. * config/nds32/nds32-md-auxillary.c: ditto. * config/nds32/nds32-memory-manipulationx.c: ditto. * config/nds32/nds32-pipelines-auxillary.c: ditto. * config/nds32/nds32-predicates.c: ditto. * config/nios2/nios2.c: ditto. * config/nvptx/nvptx.c: ditto. * config/pa/pa.c: ditto. * config/pdp11/pdp11x.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78-cx.c: ditto. * config/rs6000/rs6000.c: ditto. * config/rs6000/rs6000-c.c: ditto. * config/rx/rx.c: ditto. * config/s390/s390.c: ditto. * config/sh/sh.c: ditto. * config/sh/sc.c: ditto. * config/sh/sh-mem.cc: ditto. * config/sh/sh_treg_combine.cc: Include symtab.h, inchash.h and tree.h due to flattening of tree.h. Remove include of tree-core.h. * config/sol2.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/sol2-c.c: ditto. * config/sol2-cxx.c: ditto. * config/sol2-stubs.c: ditto. * config/sparc/sparc.c: ditto. * config/sparc/sparc-cx.c: ditto. * config/spu/spu.c: ditto. * config/spu/spu-c.c: ditto * config/storym16/stormy16.c: ditto. * config/tilegx/tilegx.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/gen-mul-tables.cc: Include symtab.h in generated file. * config/tilegx/tilegx-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/v850/v850.c: ditto. * config/v850/v850-c.c: ditto. * config/vax/vax.c: ditto. * config/vms/vms.c: ditto. * config/vms/vms-c.c: ditto. * config/vxworks.c: ditto. * config/winnt-c.c: ditto. * config/xtensa/xtensa.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * coverage.c: ditto. * cp/call.c: ditto. * cp/class.c: ditto. * cp/constexpr.c: ditto. * cp/cp-array-notation.c: ditto. * cp/cp-gimplify.c: ditto. * cp/cp-lang.c: ditto. * cp/cp-objcp-common.c: ditto. * cp/cvt.c: ditto. * cp/decl2.c: ditto. * cp/decl.c: ditto. * cp/dump.c: ditto. * cp/error.c: ditto. * cp/except.c: ditto. * cp/expr.c: ditto. * cp/friend.c: ditto. * cp/init.c: ditto. * cp/lambda.c: ditto. * cp/lex.c: ditto. * cp/mangle.c: ditto. * cp/name-lookup.c: ditto. * cp/optimize.c: ditto. * cp/parser.c: ditto. * cp/pt.c: ditto. * cp/ptree.c: ditto. * cp/repo.c: ditto. * cp/rtti.c: ditto. * cp/search.c: ditto. * cp/semantics.c: ditto. * cp/tree.c: ditto. * cp/typeck2.c: ditto. * cp/typeck.c: ditto. * cppbuiltin.c: ditto. * cprop.c: ditto. * cse.c: Add include of symtab.h due to flattening of tree.h. * cselib.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * data-streamer.c: ditto. * data-streamer-in.c: ditto. * data-streamer-out.c: ditto. * dbxout.c: ditto. * dce.c: ditto. * ddg.c: Add include of symtab.h due to flattening of tree.h. * debug.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * dfp.c: ditto. * df-scan.c: ditto. * dojump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * double-int.c: ditto. * dse.c: ditto. * dumpfile.c: ditto. * dwarf2asm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * dwarf2cfi.c: ditto. * dwarf2out.c: ditto. * emit-rtl.c: ditto. * except.c: ditto. * explow.c: ditto. * expmed.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * expr.c: ditto. * final.c: ditto. * fixed-value.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and fixed-value.h due to flattening of tree.h. * fold-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. Relocate inline function convert_to_ptrofftype_loc from tree.h. Relocate inline function fold_build_pointer_plus_loc from tree.h. Relocate inline function fold_build_pointer_plus_hwi_loc from tree.h. * fold-const.h: Relocate macro convert_to_ptrofftype from tree.h. Relocate macro fold_build_pointer_plus to relocate from tree.h.h. Relocate macro fold_build_pointer_plus_hwi from tree.h. Add prototype for convert_to_ptrofftype_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_hwi_loc relocated from tree.h. * fortran/convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/cpp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/decl.c: ditto. * fortran/f95.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/iresolve.c: ditto. * fortran/match.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/module.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/options.c: ditto. * fortran/target-memory.c: Include hash-set.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-array.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-common.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-const.c: ditto. * fortran/trans-decl.c: ditto. * fortran/trans-expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-intrinsic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * fortran/trans-io.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-openmp.c: ditto. * fortran/trans-stmt.c: ditto. * fortran/trans-types.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * function.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gcc-plugin.h: Include statistics.h, double-int.h, real.h, fixed-value.h, alias.h, flags.h, and symtab.h due to flattening of tree.h * gcse.c: ditto. * generic-match-head.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ggc-page.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-builder.c: ditto. * gimple.c: ditto. * gimple-expr.c: ditto. * gimple-fold.c: ditto. * gimple-iterator.c: ditto. * gimple-low.c: ditto. * gimple-match-head.c: ditto. * gimple-pretty-print.c: ditto. * generic-ssa-isolate-paths.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-ssa-strength-reduction.c: ditto. * gimple-streamer-in.c: ditto. * gimple-streamer-out.c: ditto. * gimple-walk.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify-me.c: ditto. * go/go-gcc.cc: ditto. * go/go-lang.c: ditto. * go/gdump.c: ditto. * graphite-blocking.c: ditto. * graphite.c: ditto. * graphite-dependencies.c: ditto. * graphite-interchange.c: ditto. * graphite-isl-ast-to-gimple.c: ditto. * graphite-optimize-isl.c: ditto. * graphite-poly.c: ditto. * graphite-scop-detection.c: ditto. * graphite-sese-to-poly.c: ditto. * hw-doloop.c: Include symtab.h due to flattening of tree.h. * ifcvt.c: ditto. * init-regs.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * internal-fc.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa.c: ditto. * ipa-chkp.c: ditto. * ipa-comdats.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-cp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-devirt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf-gimple.c: ditto. * ipa-inline-analysis.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-inline.c: ditto. * ipa-inline-transform.c: ditto. * ipa-polymorhpic-call.c: ditto. * ipa-profile.c: ditto. * ipa-prop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-pure-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-reference.c: ditto. * ipa-split.c: ditto. * ipa-utils.c: ditto. * ipa-visbility.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ira.c: ditto. * ira-color.c: Include hash-set.h due to flattening of tree.h. * ira-costs.c: ditto. * ira-emit.c: ditto. * java/boehm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/builtins.c: ditto. * java/class.c: ditto. * java/constants.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/decl.c: ditto. * java/except.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h,inchash.h and real.h due to flattening of tree.h. * java/gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/jcf-dump.c: ditto. * java/jcf-io.c: ditto. * java/jcf-parse.c: ditto. * java/jvgenmain.c: ditto. * java/lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle_name.c: ditto. * java/resource.c: ditto. * java/typeck.c: ditto. * java/verify-glue.c: ditto. * java/verify-impl.c: ditto. * jump.c: Include symtab.h due to flattening of tree.h. * langhooks.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-doloop.c: Include symtab.h due to flattening of tree.h. * loop-init.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-invariant.c: Include symtab.h due to flattening of tree.h. * loop-iv.c: ditto. * loop-unroll.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lower-subreg.c: ditto. * lra-assigns.c: Include symtab.h due to flattening of tree.h. * lra.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * lra-coalesce.c: Include symtab.h due to flattening of tree.h. * lra-constraints.c: ditto. * lra-eliminations.c: ditto. * lra-livesc: ditto. * lra-remat.c: ditto. * lra-spills.c: ditto. * lto/lto.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-object.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-partition.c: ditto. * lto/lto-symtab.c: ditto. * lto-cgraph.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-compress.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-opts.c: ditto. * lto-section-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-section-out.c: ditto. * lto-streamer.c: ditto. * lto-streamer-in.c: ditto. * lto-streamer-out.c: ditto. * modulo-sched.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-act.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-encoding.c: ditto. * objc/objc-gnu-runtime-abi-01.c: ditto. * objc/objc-lang.c: ditto. * objc/objc-map.c: ditto. * objc/objc-next-runtime-abi-01.c: ditto. * objc/objc-next-runtime-abi-02.c: ditto. * objc/objc-runtime-shared-support.c: ditto. * objcp/objcp-decl.c: ditto. * objcp/objcp-lang.c: ditto. * omega.c: ditto. * omega-low.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * optabs.c: ditto. * opts-global.c: ditto. * passes.c: ditto. * plugin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * postreload.c: Include symtab.h due to flattening of tree.h. * postreload-gcse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * predict.c: ditto. * print-rtl.c: ditto. * print-tree.c: ditto. * profile.c: Include symtab.h, fold-const.h and inchash.h due to flattening of tree.h. * real.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * realmpfr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * recog.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ree.c: ditto. * reginfo.c: ditto. * reg-stack.c: ditto. * reload1.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * reload.c: Include symtab.h due to flattening of tree.h. * reorg.c: ditto. * rtlanal.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * rtl-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * rtlhooks.c: Include symtab.h due to flattening of tree.h. * sanopt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-deps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-vis.c: ditto. * sdbout.c: ditto. * sel-sched.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * sel-sched-ir.c: ditto. * sese.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * shrink-wrap.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * simplify-rtx.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * stack-ptr-mod.c: ditto. * stmt.c: ditto. * store-motion.c: ditto. * store-layout.c: ditto. * stringpool.c: ditto. * symtab.c: ditto. * target-globals.c: ditto. * targhooks.c: ditto. * toplev.c: ditto. * tracer.c: ditto. * trans-mem.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-affine.c: ditto. * tree-browser.c: ditto. * tree.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-call-cdce.c: Include symtab.h, alias.h, double-int.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-cfg.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-cfgcleanup.c: ditto. * tree-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-chkp-opt.c: ditto. * tree-chrec.c: ditto. * tree-chkp-opt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-core.h: Flatten header file by removing all #include statements. * tree-data-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-dfa.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-diagnostic.c: ditto. * tree-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-dfa.c: ditto. * tree-eh.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-emutls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree.h: Flatten header files by removing all includes except tree-core.h. Remove inline function convert_to_ptrofftype_loc to relocate to fold-const.c. Remove macro convert_to_ptrofftype to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_hwi_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus_hwi to relocate to fold-const.h. * tree-if-conv.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-inline.c: ditto. * tree-into-ssa.c: ditto. * tree-iterator.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-loop-distribution.c: ditto. * tree-nested.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-nrv.c: ditto. * tree-object-size.c: ditto. * tree-outof-ssa.c: ditto. * tree-parloops.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-phinodes.c: ditto. * tree-predcom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-pretty-print.c: ditto. * tree-profile.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-scalar-evolution.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-sra.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-ssa-alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa.c: ditto. * tree-ssa-ccp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-coalesce.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-copy.c: ditto. * tree-ssa-copyrename.c: ditto. * tree-ssa-dce.c: ditto. * tree-ssa-dom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-dse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-forwprop.c: ditto. * tree-ssa-ifcombine.c: ditto. * tree-ssa-live.c: ditto. * tree-ssa-loop.c: ditto. * tree-ssa-loop-ch.c: ditto. * tree-ssa-loop-im.c: ditto. * tree-ssa-loop-ivcanon.c: ditto. * tree-ssa-loop-ivopts.c: ditto. * tree-ssa-loop-manip.c: ditto. * tree-ssa-loop-niter.c: ditto. * tree-ssa-loop-prefetch.c: ditto. * tree-ssa-loop-unswitch.c: ditto. * tree-ssa-loop-math-opts.c: ditto. * tree-ssanames.c: ditto. * tree-ssa-operands.c: ditto. * tree-ssa-phiopt.c: ditto. * tree-ssa-phiprop.c: ditto. * tree-ssa-pre.c: ditto. * tree-ssa-propagate.c: ditto. * tree-ssa-reassoc.c: ditto. * tree-ssa-sccvn.c: ditto. * tree-ssa-sink.c: ditto. * tree-ssa-strlen.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-structalias.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-tail-merge.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-ter.c: ditto. * tree-ssa-threadedge.c: ditto. * tree-ssa-threadupdate.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uncprop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uninit.c: ditto. * tree-stdarg.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-streamer-out.c: dittoo. * tree-switch-conversion.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-tailcall.c: ditto. * tree-vect-data-refs.c: ditto. * tree-vect-generic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop-manip.c: ditto. * tree-vectorizer.c: ditto. * tree-vect-patterns.c: ditto. * tree-vect-slp.c: ditto. * tree-vect-stmts.c: ditto. * tree-vrp.c: ditto. * tsan.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * ubsan.c: ditto. * value-prof.c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * varasm.c: ditto. * varpool.c: ditto. * var-tracking.c: ditto. * vmsdbgout.c: ditto. * vtable-verify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * wide-int.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * xcoffout.c: ditto. * libcc1/plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. From-SVN: r219402
2015-01-09 21:18:42 +01:00
#include "tree.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "gimple.h"
alias.c: Reorder #include statements and remove duplicates. 2015-10-29 Andrew MacLeod <amacleod@redhat.com> * alias.c: Reorder #include statements and remove duplicates. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-common.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-poly.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int-print.cc: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. From-SVN: r229526
2015-10-29 14:57:32 +01:00
#include "alloc-pool.h"
#include "tree-pass.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "ssa.h"
alias.c: Reorder #include statements and remove duplicates. 2015-10-29 Andrew MacLeod <amacleod@redhat.com> * alias.c: Reorder #include statements and remove duplicates. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-common.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-poly.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * statistics.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int-print.cc: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. From-SVN: r229526
2015-10-29 14:57:32 +01:00
#include "tree-streamer.h"
#include "cgraph.h"
#include "diagnostic.h"
genattrtab.c (write_header): Include hash-set.h... 2015-01-09 Michael Collison <michael.collison@linaro.org> * genattrtab.c (write_header): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-attrtab.c. * genautomata.c (main) : Include hash-set.h, macInclude hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-automata.c. * genemit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-emit.c. * gengtype.c (open_base_files): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating gtype-desc.c. * genopinit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-opinit.c. * genoutput.c (output_prologue): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-output.c. * genpeep.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-peep.c. * genpreds.c (write_insn_preds_c): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-preds.c. * optc-save-gen-awk: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating options-save.c. * opth-gen.awk: Change include guard from GCC_C_COMMON_H to GCC_C_COMMON_C when generating options.h. * ada/gcc-interface/cuintp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/decl.c: ditto. * ada/gcc-interface/misc.c: ditto. * ada/gcc-interface/targtyps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, real.h, fold-const.h, wide-int.h, inchash.h due to flattening of tree.h. * ada/gcc-interface/utils.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/utils2.c: ditto. * alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * asan.c: ditto. * attribs.c: ditto. * auto-inc-dec.c: ditto. * auto-profile.c: ditto * bb-reorder.c: ditto. * bt-load.c: Include symtab.h due to flattening of tree.h. * builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c/c-array-notation.c: ditto. * c/c-aux-info.c: ditto. * c/c-convert.c: ditto. * c/c-decl.c: ditto. * c/c-errors.c: ditto. * c/c-lang.c: dittoxs. * c/c-objc-common.c: ditto. * c/c-parser.c: ditto. * c/c-typeck.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * calls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ccmp.c: ditto. * c-family/array-notation-common.c: ditto. * c-family/c-ada-spec.c: ditto. * c-family/c-cilkplus.c: ditto. * c-family/c-common.c: Include input.h due to flattening of tree.h. Define macro GCC_C_COMMON_C. * c-family/c-common.h: Flatten tree.h header files into c-common.h. Remove include of tree-core.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: ditto. * c-family/c-format.c: Flatten tree.h header files into c-common.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-format.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * c-family/c-gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/cilk.c: ditto. * c-family/c-lex.c: ditto. * c-family/c-omp.c: ditto. * c-family/c-opts.c: ditto. * c-family/c-pch.c: ditto. * c-family/c-ppoutput.c: ditto. * c-family/c-pragma.c: ditto. * c-family/c-pretty-print.c: ditto. * c-family/c-semantics.c: ditto. * c-family/c-ubsan.c: ditto. * c-family/stub-objc.c: ditto. * cfgbuild.c: ditto. * cfg.c: ditto. * cfgcleanup.c: ditto. * cfgexpand.c: ditto. * cfghooks.c: ditto. * cfgloop.c: Include symtab.h, fold-const.h, and inchash.h due to flattening of tree.h. * cfgloopmanip.c: ditto. * cfgrtl.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * cgraphbuild.c: ditto. * cgraph.c: ditto. * cgraphclones.c: ditto. * cgraphunit.c: ditto. * cilk-common.c: ditto. * combine.c: ditto. * combine-stack-adj.c: Include symbol.h due to flattening of tree.h. * config/aarch64/aarch64-builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/aarch64/aarch64.c: ditto. * config/alpha/alpha.c: ditto. * config/arc/arc.c: ditto. * config/arm/aarch-common.c: ditto. * config/arm/arm-builtins.c: ditto. * config/arm/arm.c: ditto. * config/arm/arm-c.c: ditto. * config/avr/avr.c: ditto. * config/avr/avr-c.c: ditto. * config/avr/avr-log.c: ditto. * config/bfin/bfin.c: ditto. * config/c6x/c6x.c: ditto. * config/cr16/cr16.c: ditto. * config/cris/cris.c: ditto. * config/darwin.c: ditto. * config/darwin-c.c: ditto. * config/default-c.c: ditto. * config/epiphany/epiphany.c: ditto. * config/fr30/fr30.c: ditto. * config/frv/frv.c: ditto. * config/glibc-c.c: ditto. * config/h8300/h8300.c: ditto. * config/i386/i386.c: ditto. * config/i386/i386-c.c: ditto. * config/i386/msformat.c: ditto. * config/i386/winnt.c: ditto. * config/i386/winnt-cxx.c: ditto. * config/i386/winnt-stubs.c: ditto. * config/ia64/ia64.c: ditto. * config/ia64/ia64-c.c: ditto. * config/iq2000/iq2000.c: ditto. * config/lm32/lm32.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c-pragma.c: ditto. * config/m32c/m32cr.c: ditto. * config/m68/m68k.c: ditto. * config/mcore/mcore.c: ditto. * config/mep/mep.c: ditto. * config/mep/mep-pragma.c: ditto. * config/microblaze/microblaze.c: ditto. * config/microblaze/microblaze-c.c: ditto. * config/mips/mips.c: ditto. * config/mmix/mmix.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/mn10300/mn10300.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/moxie/moxie.c: ditto. * config/msp430/msp430.c: ditto. * config/msp430/msp430-c.c: ditto. * config/nds32/nds32.c: ditto. * config/nds32/nds32-cost.c: ditto. * config/nds32/nds32-fp-as-gp.c: ditto. * config/nds32/nds32-intrinsic.c: ditto. * config/nds32/nds32-isr.c: ditto. * config/nds32/nds32-md-auxillary.c: ditto. * config/nds32/nds32-memory-manipulationx.c: ditto. * config/nds32/nds32-pipelines-auxillary.c: ditto. * config/nds32/nds32-predicates.c: ditto. * config/nios2/nios2.c: ditto. * config/nvptx/nvptx.c: ditto. * config/pa/pa.c: ditto. * config/pdp11/pdp11x.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78-cx.c: ditto. * config/rs6000/rs6000.c: ditto. * config/rs6000/rs6000-c.c: ditto. * config/rx/rx.c: ditto. * config/s390/s390.c: ditto. * config/sh/sh.c: ditto. * config/sh/sc.c: ditto. * config/sh/sh-mem.cc: ditto. * config/sh/sh_treg_combine.cc: Include symtab.h, inchash.h and tree.h due to flattening of tree.h. Remove include of tree-core.h. * config/sol2.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/sol2-c.c: ditto. * config/sol2-cxx.c: ditto. * config/sol2-stubs.c: ditto. * config/sparc/sparc.c: ditto. * config/sparc/sparc-cx.c: ditto. * config/spu/spu.c: ditto. * config/spu/spu-c.c: ditto * config/storym16/stormy16.c: ditto. * config/tilegx/tilegx.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/gen-mul-tables.cc: Include symtab.h in generated file. * config/tilegx/tilegx-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/v850/v850.c: ditto. * config/v850/v850-c.c: ditto. * config/vax/vax.c: ditto. * config/vms/vms.c: ditto. * config/vms/vms-c.c: ditto. * config/vxworks.c: ditto. * config/winnt-c.c: ditto. * config/xtensa/xtensa.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * coverage.c: ditto. * cp/call.c: ditto. * cp/class.c: ditto. * cp/constexpr.c: ditto. * cp/cp-array-notation.c: ditto. * cp/cp-gimplify.c: ditto. * cp/cp-lang.c: ditto. * cp/cp-objcp-common.c: ditto. * cp/cvt.c: ditto. * cp/decl2.c: ditto. * cp/decl.c: ditto. * cp/dump.c: ditto. * cp/error.c: ditto. * cp/except.c: ditto. * cp/expr.c: ditto. * cp/friend.c: ditto. * cp/init.c: ditto. * cp/lambda.c: ditto. * cp/lex.c: ditto. * cp/mangle.c: ditto. * cp/name-lookup.c: ditto. * cp/optimize.c: ditto. * cp/parser.c: ditto. * cp/pt.c: ditto. * cp/ptree.c: ditto. * cp/repo.c: ditto. * cp/rtti.c: ditto. * cp/search.c: ditto. * cp/semantics.c: ditto. * cp/tree.c: ditto. * cp/typeck2.c: ditto. * cp/typeck.c: ditto. * cppbuiltin.c: ditto. * cprop.c: ditto. * cse.c: Add include of symtab.h due to flattening of tree.h. * cselib.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * data-streamer.c: ditto. * data-streamer-in.c: ditto. * data-streamer-out.c: ditto. * dbxout.c: ditto. * dce.c: ditto. * ddg.c: Add include of symtab.h due to flattening of tree.h. * debug.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * dfp.c: ditto. * df-scan.c: ditto. * dojump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * double-int.c: ditto. * dse.c: ditto. * dumpfile.c: ditto. * dwarf2asm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * dwarf2cfi.c: ditto. * dwarf2out.c: ditto. * emit-rtl.c: ditto. * except.c: ditto. * explow.c: ditto. * expmed.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * expr.c: ditto. * final.c: ditto. * fixed-value.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and fixed-value.h due to flattening of tree.h. * fold-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. Relocate inline function convert_to_ptrofftype_loc from tree.h. Relocate inline function fold_build_pointer_plus_loc from tree.h. Relocate inline function fold_build_pointer_plus_hwi_loc from tree.h. * fold-const.h: Relocate macro convert_to_ptrofftype from tree.h. Relocate macro fold_build_pointer_plus to relocate from tree.h.h. Relocate macro fold_build_pointer_plus_hwi from tree.h. Add prototype for convert_to_ptrofftype_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_hwi_loc relocated from tree.h. * fortran/convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/cpp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/decl.c: ditto. * fortran/f95.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/iresolve.c: ditto. * fortran/match.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/module.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/options.c: ditto. * fortran/target-memory.c: Include hash-set.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-array.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-common.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-const.c: ditto. * fortran/trans-decl.c: ditto. * fortran/trans-expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-intrinsic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * fortran/trans-io.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-openmp.c: ditto. * fortran/trans-stmt.c: ditto. * fortran/trans-types.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * function.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gcc-plugin.h: Include statistics.h, double-int.h, real.h, fixed-value.h, alias.h, flags.h, and symtab.h due to flattening of tree.h * gcse.c: ditto. * generic-match-head.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ggc-page.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-builder.c: ditto. * gimple.c: ditto. * gimple-expr.c: ditto. * gimple-fold.c: ditto. * gimple-iterator.c: ditto. * gimple-low.c: ditto. * gimple-match-head.c: ditto. * gimple-pretty-print.c: ditto. * generic-ssa-isolate-paths.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-ssa-strength-reduction.c: ditto. * gimple-streamer-in.c: ditto. * gimple-streamer-out.c: ditto. * gimple-walk.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify-me.c: ditto. * go/go-gcc.cc: ditto. * go/go-lang.c: ditto. * go/gdump.c: ditto. * graphite-blocking.c: ditto. * graphite.c: ditto. * graphite-dependencies.c: ditto. * graphite-interchange.c: ditto. * graphite-isl-ast-to-gimple.c: ditto. * graphite-optimize-isl.c: ditto. * graphite-poly.c: ditto. * graphite-scop-detection.c: ditto. * graphite-sese-to-poly.c: ditto. * hw-doloop.c: Include symtab.h due to flattening of tree.h. * ifcvt.c: ditto. * init-regs.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * internal-fc.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa.c: ditto. * ipa-chkp.c: ditto. * ipa-comdats.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-cp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-devirt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf-gimple.c: ditto. * ipa-inline-analysis.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-inline.c: ditto. * ipa-inline-transform.c: ditto. * ipa-polymorhpic-call.c: ditto. * ipa-profile.c: ditto. * ipa-prop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-pure-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-reference.c: ditto. * ipa-split.c: ditto. * ipa-utils.c: ditto. * ipa-visbility.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ira.c: ditto. * ira-color.c: Include hash-set.h due to flattening of tree.h. * ira-costs.c: ditto. * ira-emit.c: ditto. * java/boehm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/builtins.c: ditto. * java/class.c: ditto. * java/constants.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/decl.c: ditto. * java/except.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h,inchash.h and real.h due to flattening of tree.h. * java/gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/jcf-dump.c: ditto. * java/jcf-io.c: ditto. * java/jcf-parse.c: ditto. * java/jvgenmain.c: ditto. * java/lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle_name.c: ditto. * java/resource.c: ditto. * java/typeck.c: ditto. * java/verify-glue.c: ditto. * java/verify-impl.c: ditto. * jump.c: Include symtab.h due to flattening of tree.h. * langhooks.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-doloop.c: Include symtab.h due to flattening of tree.h. * loop-init.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-invariant.c: Include symtab.h due to flattening of tree.h. * loop-iv.c: ditto. * loop-unroll.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lower-subreg.c: ditto. * lra-assigns.c: Include symtab.h due to flattening of tree.h. * lra.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * lra-coalesce.c: Include symtab.h due to flattening of tree.h. * lra-constraints.c: ditto. * lra-eliminations.c: ditto. * lra-livesc: ditto. * lra-remat.c: ditto. * lra-spills.c: ditto. * lto/lto.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-object.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-partition.c: ditto. * lto/lto-symtab.c: ditto. * lto-cgraph.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-compress.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-opts.c: ditto. * lto-section-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-section-out.c: ditto. * lto-streamer.c: ditto. * lto-streamer-in.c: ditto. * lto-streamer-out.c: ditto. * modulo-sched.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-act.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-encoding.c: ditto. * objc/objc-gnu-runtime-abi-01.c: ditto. * objc/objc-lang.c: ditto. * objc/objc-map.c: ditto. * objc/objc-next-runtime-abi-01.c: ditto. * objc/objc-next-runtime-abi-02.c: ditto. * objc/objc-runtime-shared-support.c: ditto. * objcp/objcp-decl.c: ditto. * objcp/objcp-lang.c: ditto. * omega.c: ditto. * omega-low.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * optabs.c: ditto. * opts-global.c: ditto. * passes.c: ditto. * plugin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * postreload.c: Include symtab.h due to flattening of tree.h. * postreload-gcse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * predict.c: ditto. * print-rtl.c: ditto. * print-tree.c: ditto. * profile.c: Include symtab.h, fold-const.h and inchash.h due to flattening of tree.h. * real.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * realmpfr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * recog.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ree.c: ditto. * reginfo.c: ditto. * reg-stack.c: ditto. * reload1.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * reload.c: Include symtab.h due to flattening of tree.h. * reorg.c: ditto. * rtlanal.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * rtl-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * rtlhooks.c: Include symtab.h due to flattening of tree.h. * sanopt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-deps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-vis.c: ditto. * sdbout.c: ditto. * sel-sched.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * sel-sched-ir.c: ditto. * sese.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * shrink-wrap.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * simplify-rtx.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * stack-ptr-mod.c: ditto. * stmt.c: ditto. * store-motion.c: ditto. * store-layout.c: ditto. * stringpool.c: ditto. * symtab.c: ditto. * target-globals.c: ditto. * targhooks.c: ditto. * toplev.c: ditto. * tracer.c: ditto. * trans-mem.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-affine.c: ditto. * tree-browser.c: ditto. * tree.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-call-cdce.c: Include symtab.h, alias.h, double-int.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-cfg.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-cfgcleanup.c: ditto. * tree-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-chkp-opt.c: ditto. * tree-chrec.c: ditto. * tree-chkp-opt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-core.h: Flatten header file by removing all #include statements. * tree-data-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-dfa.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-diagnostic.c: ditto. * tree-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-dfa.c: ditto. * tree-eh.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-emutls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree.h: Flatten header files by removing all includes except tree-core.h. Remove inline function convert_to_ptrofftype_loc to relocate to fold-const.c. Remove macro convert_to_ptrofftype to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_hwi_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus_hwi to relocate to fold-const.h. * tree-if-conv.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-inline.c: ditto. * tree-into-ssa.c: ditto. * tree-iterator.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-loop-distribution.c: ditto. * tree-nested.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-nrv.c: ditto. * tree-object-size.c: ditto. * tree-outof-ssa.c: ditto. * tree-parloops.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-phinodes.c: ditto. * tree-predcom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-pretty-print.c: ditto. * tree-profile.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-scalar-evolution.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-sra.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-ssa-alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa.c: ditto. * tree-ssa-ccp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-coalesce.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-copy.c: ditto. * tree-ssa-copyrename.c: ditto. * tree-ssa-dce.c: ditto. * tree-ssa-dom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-dse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-forwprop.c: ditto. * tree-ssa-ifcombine.c: ditto. * tree-ssa-live.c: ditto. * tree-ssa-loop.c: ditto. * tree-ssa-loop-ch.c: ditto. * tree-ssa-loop-im.c: ditto. * tree-ssa-loop-ivcanon.c: ditto. * tree-ssa-loop-ivopts.c: ditto. * tree-ssa-loop-manip.c: ditto. * tree-ssa-loop-niter.c: ditto. * tree-ssa-loop-prefetch.c: ditto. * tree-ssa-loop-unswitch.c: ditto. * tree-ssa-loop-math-opts.c: ditto. * tree-ssanames.c: ditto. * tree-ssa-operands.c: ditto. * tree-ssa-phiopt.c: ditto. * tree-ssa-phiprop.c: ditto. * tree-ssa-pre.c: ditto. * tree-ssa-propagate.c: ditto. * tree-ssa-reassoc.c: ditto. * tree-ssa-sccvn.c: ditto. * tree-ssa-sink.c: ditto. * tree-ssa-strlen.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-structalias.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-tail-merge.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-ter.c: ditto. * tree-ssa-threadedge.c: ditto. * tree-ssa-threadupdate.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uncprop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uninit.c: ditto. * tree-stdarg.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-streamer-out.c: dittoo. * tree-switch-conversion.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-tailcall.c: ditto. * tree-vect-data-refs.c: ditto. * tree-vect-generic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop-manip.c: ditto. * tree-vectorizer.c: ditto. * tree-vect-patterns.c: ditto. * tree-vect-slp.c: ditto. * tree-vect-stmts.c: ditto. * tree-vrp.c: ditto. * tsan.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * ubsan.c: ditto. * value-prof.c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * varasm.c: ditto. * varpool.c: ditto. * var-tracking.c: ditto. * vmsdbgout.c: ditto. * vtable-verify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * wide-int.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * xcoffout.c: ditto. * libcc1/plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. From-SVN: r219402
2015-01-09 21:18:42 +01:00
#include "fold-const.h"
gimple.h: Remove all includes. * gimple.h: Remove all includes. (recalculate_side_effects): Move prototype to gimplify.h. * Makefile.in (PLUGIN_HEADERS): Add flattened gimple.h includes. * gengtype.c (open_base_files): Add gimple.h include list. * gimplify.h (recalculate_side_effects): Relocate prototype here. * gimple.c: Adjust include list. (recalculate_side_effects): Move to gimplify.c. * gimplify.c: Adjust include list. (recalculate_side_effects): Relocate from gimple.c. * alias.c: Add required include files removed from gimple.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphbuild.c: Likewise. * cgraph.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * data-streamer.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * graphite-blocking.c: Likewise. * graphite.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * ipa.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * symtab.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * varpool.c: Likewise. * var-tracking.c: Likewise. * vtable-verify.c: Likewise. * ada/gcc-interface/trans.c: Add required include files from gimple.h. * c/c-typeck.c: Add required include files from gimple.h. * c-family/c-common.c: Add required include files from gimple.h. * c-family/c-gimplify.c: Likewise * c-family/cilk.c: Likewise * cp/class.c: Add required include files from gimple.h. * cp/cp-gimplify.c: Likewise * cp/decl2.c: Likewise * cp/init.c: Likewise * cp/optimize.c: Likewise * cp/pt.c: Likewise * cp/semantics.c: Likewise * cp/tree.c: Likewise * cp/typeck.c: Likewise * cp/vtable-class-hierarchy.c: Likewise * fortran/trans.c: Add required include files from gimple.h. * fortran/trans-expr.c: Likewise * fortran/trans-openmp.c: Likewise * go/gofrontend/expressions.cc: Add required include files from gimple.h. * go/gofrontend/gogo-tree.cc: Likewise * go/gofrontend/types.cc: Likewise * go/go-gcc.cc: Likewise * go/go-lang.c: Likewise * java/java-gimplify.c: Add required include files from gimple.h. * lto/lto.c: Add required include files from gimple.h. * lto/lto-lang.c: Likewise * lto/lto-object.c: Likewise * lto/lto-partition.c: Likewise * lto/lto-symtab.c: Likewise * objc/objc-act.c: Add required include files from gimple.h. * config/darwin.c: Add required include files removed from gimple.h. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/m32c/m32c.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * testsuite/gcc.dg/plugin/finish_unit_plugin.c: Add required include files removed from gimple.h. * testsuite/gcc.dg/plugin/ggcplug.c: Likewise. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. * testsuite/gcc.dg/plugin/start_unit_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. From-SVN: r205272
2013-11-22 16:58:51 +01:00
#include "gimple-fold.h"
#include "tree-eh.h"
dojump.h: New header file. 2015-10-15 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * dojump.h: New header file. * explow.h: Likewise. * expr.h: Remove includes. Move expmed.c prototypes to expmed.h. Move dojump.c prototypes to dojump.h. Move alias.c prototypes to alias.h. Move explow.c prototypes to explow.h. Move calls.c prototypes to calls.h. Move emit-rtl.c prototypes to emit-rtl.h. Move varasm.c prototypes to varasm.h. Move stmt.c prototypes to stmt.h. (saved_pending_stack_adjust): Move to dojump.h. (adjust_address): Move to explow.h. (adjust_address_nv): Move to emit-rtl.h. (adjust_bitfield_address): Likewise. (adjust_bitfield_address_size): Likewise. (adjust_bitfield_address_nv): Likewise. (adjust_automodify_address_nv): Likewise. * explow.c (expr_size): Move to expr.c. (int_expr_size): Likewise. (tree_expr_size): Likewise. Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h varasm.h. * genemit.c (main): Generate includes statistics.h, real.h, fixed-value.h, insn-config.h, expmed.h, dojump.h, explow.h, emit-rtl.h, stmt.h. * genopinit.c (main): Generate includes hashtab.h, hard-reg-set.h, function.h, statistics.h, real.h, fixed-value.h, expmed.h, dojump.h, explow.h, emit-rtl.h, stmt.h. * genoutput.c (main): Generate includes hashtab.h, statistics.h, real.h, fixed-value.h, expmed.h, dojump.h, explow.h, emit-rtl.h, stmt.h. * genemit.c (open_base_files): Generate includes flags.h, statistics.h, real.h, fixed-value.h, tree.h, expmed.h, dojump.h, explow.h, calls.h, emit-rtl.h, varasm.h, stmt.h. * config/tilepro/gen-mul-tables.cc: Generate includes hashtab.h, hash-set.h, vec.h, machmode.h, tm.h, hard-reg-set.h, input.h, function.h, rtl.h, flags.h, statistics.h, double-int.h, real.h, fixed-value.h, alias.h, wide-int.h, inchash.h, tree.h, insn-config.h, expmed.h, dojump.h, explow.h, calls.h, emit-rtl.h, varasm.h, stmt.h. * config/tilegx/mul-tables.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hash-set.h hashtab.h inchash.h input.h insn-config.h machmode.h real.h rtl.h statistics.h stmt.h symtab.h tm.h tree.h varasm.h vec.h wide-int.h. * rtlhooks.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hash-set.h hashtab.h inchash.h input.h insn-config.h machmode.h real.h statistics.h stmt.h tree.h varasm.h vec.h wide-int.h. * cfgloopanal.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h inchash.h insn-config.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * loop-iv.c: Likewise. * lra-assigns.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h inchash.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * bt-load.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h inchash.h insn-config.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * hw-doloop.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * loop-doloop.c: Likewise. * loop-invariant.c: Likewise. * reload.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h inchash.h real.h rtl.h statistics.h stmt.h tree.h varasm.h wide-int.h. * caller-save.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h inchash.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * combine-stack-adj.c: Likewise. * cse.c: Likewise. * ddg.c: Likewise. * ifcvt.c: Likewise. * ira-costs.c: Likewise. * jump.c: Likewise. * lra-coalesce.c: Likewise. * lra-spills.c: Likewise. * profile.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h varasm.h wide-int.h. * lra.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h varasm.h. * config/sh/sh_treg_combine.cc: Include alias.h calls.h dojump.h double-int.h explow.h expmed.h fixed-value.h flags.h real.h statistics.h stmt.h varasm.h wide-int.h. * reorg.c: Include alias.h calls.h dojump.h double-int.h explow.h expmed.h fixed-value.h inchash.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * reload1.c: Include alias.h calls.h dojump.h double-int.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h varasm.h. * config/tilegx/tilegx.c: Include alias.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h real.h statistics.h stmt.h. * config/tilepro/tilepro.c: Likewise. * config/mmix/mmix.c: Include alias.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h. * config/pdp11/pdp11.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/lm32/lm32.c: Include alias.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h varasm.h. * tree-chkp.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h tm.h. * cilk-common.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h tm.h varasm.h. * rtl-chkp.c: Likewise. * tree-chkp-opt.c: Likewise. * config/arm/arm-builtins.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * ipa-icf.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h. * tree-vect-data-refs.c: Likewise. * graphite-sese-to-poly.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * internal-fn.c: Likewise. * ipa-icf-gimple.c: Likewise. * lto-section-out.c: Likewise. * tree-data-ref.c: Likewise. * tree-nested.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tsan.c: Likewise. * targhooks.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h. * config/sh/sh-mem.cc: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * loop-unroll.c: Likewise. * ubsan.c: Likewise. * tree-ssa-loop-prefetch.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h real.h rtl.h statistics.h stmt.h varasm.h. * dse.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h function.h hashtab.h statistics.h stmt.h varasm.h. * tree-switch-conversion.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h. * generic-match-head.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * gimple-match-head.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-if-conv.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-generic.c: Likewise. * tree-sra.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h stmt.h varasm.h. * stor-layout.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h statistics.h stmt.h. * varasm.c: Likewise. * coverage.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * init-regs.c: Likewise. * ira.c: Likewise. * omp-low.c: Likewise. * stack-ptr-mod.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-complex.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h rtl.h statistics.h stmt.h varasm.h. * dwarf2cfi.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h statistics.h stmt.h varasm.h. * shrink-wrap.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h rtl.h statistics.h stmt.h. * recog.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h rtl.h statistics.h stmt.h varasm.h. * tree-ssa-phiopt.c: Likewise. * config/darwin.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * optabs.c: Likewise. * passes.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * toplev.c: Likewise. * var-tracking.c: Likewise. * gcse.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h varasm.h. * lower-subreg.c: Likewise. * postreload-gcse.c: Likewise. * ree.c: Likewise. * reginfo.c: Likewise. * store-motion.c: Likewise. * combine.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h stmt.h varasm.h. * emit-rtl.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h. * dojump.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h varasm.h. * except.c: Likewise. * explow.c: Likewise. * tree-dfa.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * gimple-fold.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h rtl.h statistics.h varasm.h. * tree-ssa-structalias.c: Likewise. * cfgexpand.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h. * calls.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h. * bb-reorder.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h varasm.h. * cfgbuild.c: Likewise. * function.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h. * cfgrtl.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h varasm.h. * dbxout.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h. * auto-inc-dec.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h varasm.h. * cprop.c: Likewise. * modulo-sched.c: Likewise. * postreload.c: Likewise. * ccmp.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * gimple-ssa-strength-reduction.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * tree-ssa-loop-ivopts.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h flags.h hashtab.h real.h rtl.h statistics.h stmt.h varasm.h. * expmed.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h function.h hard-reg-set.h hashtab.h real.h statistics.h stmt.h varasm.h. * target-globals.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h function.h hashtab.h real.h statistics.h stmt.h varasm.h. * tree-ssa-address.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h hashtab.h real.h statistics.h stmt.h varasm.h. * cfgcleanup.c: Include calls.h dojump.h explow.h expmed.h fixed-value.h function.h real.h statistics.h stmt.h varasm.h. * alias.c: Include calls.h dojump.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h. * dwarf2out.c: Include calls.h dojump.h explow.h expmed.h fixed-value.h statistics.h stmt.h. * config/nvptx/nvptx.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hard-reg-set.h insn-config.h real.h statistics.h stmt.h varasm.h. * gimplify.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h. * asan.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h. * ipa-devirt.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * ipa-polymorphic-call.c: Likewise. * config/aarch64/aarch64.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h. * config/c6x/c6x.c: Likewise. * config/aarch64/aarch64-builtins.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * ipa-prop.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * ipa-split.c: Likewise. * tree-eh.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-vrp.c: Likewise. * config/nds32/nds32-cost.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h statistics.h stmt.h. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/cris/cris.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h. * config/alpha/alpha.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/cr16/cr16.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h varasm.h. * config/msp430/msp430.c: Likewise. * predict.c: Likewise. * value-prof.c: Likewise. * config/epiphany/epiphany.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h. * config/microblaze/microblaze.c: Likewise. * config/nios2/nios2.c: Likewise. * config/rs6000/rs6000.c: Likewise. * tree.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h rtl.h statistics.h stmt.h. * cgraph.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h. * fold-const.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h varasm.h. * tree-inline.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h varasm.h. * builtins.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h. * config/arc/arc.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h statistics.h stmt.h. * config/visium/visium.c: Include dojump.h emit-rtl.h explow.h expmed.h stmt.h. java/ * builtins.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h function.h hard-reg-set.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. From-SVN: r219655
2015-01-15 14:28:42 +01:00
#include "calls.h"
Factor unrelated declarations out of tree.h. This patch applies the rule that functions defined in FOO.c must be declared in FOO.h. One of the worst offenders in the code base is tree.h, unsurprisingly. The patch creates several new headers: attribs.h calls.h fold-const.h gcc-symtab.h print-rtl.h print-tree.h stmt.h stor-layout.h stringpool.h tree-nested.h tree-object-size.h varasm.h. Functions in each corresponding .c file got moved to those headers and others that already existed. I wanted to make this patch as mechanical as possible, so I made no attempt to fix problems like having build_addr defined in tree-inline.c. I left that for later. There were some declarations that I could not move out of tree.h because of header poisoning or the use of target macros. We forbid the inclusion of things like expr.h from FE files. While that's a reasonable idea, the FE file *still* manage to at expr.c functionality because the declarations they want to use were defined in tree.h. The affected files are builtins.h, emit-rtl.h and expr.h. If that functionality is allowed to be accessed from the FEs, then I will later move those functions out of expr.c into tree.c. I have moved these declarations to the bottom of tree.h so they are easy to identify later. There is a namespace collision with libcpp. The file gcc/symtab.c cannot use gcc/symtab.h because the #include command picks up libcpp/include/symtab.h first. So I named this file gcc-symtab.h for now. Finally, I added a new header to PLUGIN_HEADERS to account for the tree.h refactoring. I did not add all headers factored out of tree.h because it is unclear (and impossible to tell) what plugins need. This adds the one header used by the plugins in the testsuite. This will be changing quite dramatically as we progress with the header refactoring. This patch should offer some minimal incremental build advantages by reducing the size of tree.h. Changes that would otherwise affected tree.h, will now go to other headers which are less frequently included. * tree.h: Include fold-const.h. (aggregate_value_p): Moved to function.h. (alloca_call_p): Moved to calls.h. (allocate_struct_function): Moved to function.h. (apply_tm_attr): Moved to attribs.h. (array_at_struct_end_p): Moved to expr.h. (array_ref_element_size): Moved to tree-dfa.h. (array_ref_low_bound): Moved to tree-dfa.h. (array_ref_up_bound): Moved to tree.h. (assemble_alias): Moved to cgraph.h. (bit_from_pos): Moved to stor-layout.h. (build_addr): Moved to tree-nested.h. (build_duplicate_type): Moved to tree-inline.h. (build_fold_addr_expr): Moved to fold-const.h. (build_fold_addr_expr_with_type): Moved to fold-const.h. (build_fold_addr_expr_with_type_loc): Moved to fold-const.h. (build_fold_indirect_ref): Moved to fold-const.h. (build_fold_indirect_ref_loc): Moved to fold-const.h. (build_personality_function): Moved to tree.h. (build_range_check): Moved to fold-const.h. (build_simple_mem_ref): Moved to fold-const.h. (build_simple_mem_ref_loc): Moved to fold-const.h. (build_tm_abort_call): Moved to trans-mem.h. (byte_from_pos): Moved to stor-layout.h. (call_expr_flags): Moved to calls.h. (can_move_by_pieces): Moved to expr.h. (categorize_ctor_elements): Moved to expr.h. (change_decl_assembler_name): Moved to gcc-symtab.h. (combine_comparisons): Moved to fold-const.h. (complete_ctor_at_level_p): Moved to tree.h. (component_ref_field_offset): Moved to tree-dfa.h. (compute_builtin_object_size): Moved to tree-object-size.h. (compute_record_mode): Moved to stor-layout.h. (constant_boolean_node): Moved to fold-const.h. (constructor_static_from_elts_p): Moved to varasm.h. (cxx11_attribute_p): Moved to attribs.h. (debug_body): Moved to print-tree.h. (debug_find_tree): Moved to tree-inline.h. (debug_fold_checksum): Moved to fold-const.h. (debug_head): Moved to print-tree.h. (debug_head): Moved to print-tree.h. (debug_raw): Moved to print-tree.h. (debug_tree): Moved to print-tree.h. (debug_vec_tree): Moved to print-tree.h. (debug_verbose): Moved to print-tree.h. (debug_verbose): Moved to print-tree.h. (decl_attributes): Moved to attribs.h. (decl_binds_to_current_def_p): Moved to varasm.h. (decl_default_tls_model): Moved to varasm.h. (decl_replaceable_p): Moved to varasm.h. (div_if_zero_remainder): Moved to fold-const.h. (double_int mem_ref_offset): Moved to fold-const.h. (dump_addr): Moved to print-tree.h. (element_precision): Moved to machmode.h. (expand_dummy_function_end): Moved to function.h. (expand_function_end): Moved to function.h. (expand_function_start): Moved to function.h. (expand_label): Moved to stmt.h. (expr_first): Moved to tree-iterator.h. (expr_last): Moved to tree-iterator.h. (finalize_size_functions): Moved to stor-layout.h. (finish_builtin_struct): Moved to stor-layout.h. (finish_record_layout): Moved to stor-layout.h. (fixup_signed_type): Moved to stor-layout.h. (fixup_unsigned_type): Moved to stor-layout.h. (flags_from_decl_or_type): Moved to calls.h. (fold): Moved to fold-const.h. (fold_abs_const): Moved to fold-const.h. (fold_binary): Moved to fold-const.h. (fold_binary_loc): Moved to fold-const.h. (fold_binary_to_constant): Moved to fold-const.h. (fold_build1): Moved to fold-const.h. (fold_build1_initializer_loc): Moved to fold-const.h. (fold_build1_loc): Moved to fold-const.h. (fold_build1_stat_loc): Moved to fold-const.h. (fold_build2): Moved to fold-const.h. (fold_build2_initializer_loc): Moved to fold-const.h. (fold_build2_loc): Moved to fold-const.h. (fold_build2_stat_loc): Moved to fold-const.h. (fold_build3): Moved to fold-const.h. (fold_build3_loc): Moved to fold-const.h. (fold_build3_stat_loc): Moved to fold-const.h. (fold_build_call_array): Moved to fold-const.h. (fold_build_call_array_initializer): Moved to fold-const.h. (fold_build_call_array_initializer_loc): Moved to fold-const.h. (fold_build_call_array_loc): Moved to fold-const.h. (fold_build_cleanup_point_expr): Moved to fold-const.h. (fold_convert): Moved to fold-const.h. (fold_convert_loc): Moved to fold-const.h. (fold_convertible_p): Moved to fold-const.h. (fold_defer_overflow_warnings): Moved to fold-const.h. (fold_deferring_overflow_warnings_p): Moved to fold-const.h. (fold_fma): Moved to fold-const.h. (fold_ignored_result): Moved to fold-const.h. (fold_indirect_ref): Moved to fold-const.h. (fold_indirect_ref_1): Moved to fold-const.h. (fold_indirect_ref_loc): Moved to fold-const.h. (fold_read_from_constant_string): Moved to fold-const.h. (fold_real_zero_addition_p): Moved to fold-const.h. (fold_single_bit_test): Moved to fold-const.h. (fold_strip_sign_ops): Moved to fold-const.h. (fold_ternary): Moved to fold-const.h. (fold_ternary_loc): Moved to fold-const.h. (fold_unary): Moved to tree-data-ref.h. (fold_unary_ignore_overflow): Moved to fold-const.h. (fold_unary_ignore_overflow_loc): Moved to fold-const.h. (fold_unary_loc): Moved to fold-const.h. (fold_unary_to_constant): Moved to fold-const.h. (fold_undefer_and_ignore_overflow_warnings): Moved to fold-const.h. (fold_undefer_overflow_warnings): Moved to fold-const.h. (folding_initializer): Moved to fold-const.h. (free_temp_slots): Moved to function.h. (generate_setjmp_warnings): Moved to function.h. (get_attribute_name): Moved to attribs.h. (get_identifier): Moved to stringpool.h. (get_identifier_with_length): Moved to stringpool.h. (get_inner_reference): Moved to tree.h. (gimple_alloca_call_p): Moved to calls.h. (gimplify_parameters): Moved to function.h. (highest_pow2_factor): Moved to expr.h. (indent_to): Moved to print-tree.h. (init_attributes): Moved to attribs.h. (init_dummy_function_start): Moved to function.h. (init_function_start): Moved to function.h. (init_inline_once): Moved to tree-inline.h. (init_object_sizes): Moved to tree-object-size.h. (init_temp_slots): Moved to function.h. (init_tree_optimization_optabs): Moved to optabs.h. (initialize_sizetypes): Moved to stor-layout.h. (initializer_constant_valid_for_bitfield_p): Moved to varasm.h. (initializer_constant_valid_p): Moved to varasm.h. (int_const_binop): Moved to fold-const.h. (internal_reference_types): Moved to stor-layout.h. (invert_tree_comparison): Moved to fold-const.h. (invert_truthvalue): Moved to fold-const.h. (invert_truthvalue_loc): Moved to fold-const.h. (is_tm_ending_fndecl): Moved to trans-mem.h. (is_tm_may_cancel_outer): Moved to trans-mem.h. (is_tm_pure): Moved to trans-mem.h. (is_tm_safe): Moved to trans-mem.h. (layout_decl): Moved to stor-layout.h. (layout_type): Moved to stor-layout.h. (lookup_attribute_spec): Moved to attribs.h. (make_accum_type): Moved to stor-layout.h. (make_decl_one_only): Moved to varasm.h. (make_decl_rtl): Moved to tree.h. (make_decl_rtl_for_debug): Moved to varasm.h. (make_fract_type): Moved to stor-layout.h. (make_or_reuse_sat_signed_accum_type): Moved to stor-layout.h. (make_or_reuse_sat_signed_fract_type): Moved to stor-layout.h. (make_or_reuse_sat_unsigned_accum_type): Moved to stor-layout.h. (make_or_reuse_sat_unsigned_fract_type): Moved to stor-layout.h. (make_or_reuse_signed_accum_type): Moved to stor-layout.h. (make_or_reuse_signed_fract_type): Moved to stor-layout.h. (make_or_reuse_unsigned_accum_type): Moved to stor-layout.h. (make_or_reuse_unsigned_fract_type): Moved to stor-layout.h. (make_range): Moved to fold-const.h. (make_range_step): Moved to fold-const.h. (make_sat_signed_accum_type): Moved to stor-layout.h. (make_sat_signed_fract_type): Moved to stor-layout.h. (make_sat_unsigned_accum_type): Moved to stor-layout.h. (make_sat_unsigned_fract_type): Moved to stor-layout.h. (make_signed_accum_type): Moved to stor-layout.h. (make_signed_fract_type): Moved to stor-layout.h. (make_signed_type): Moved to stor-layout.h. (make_unsigned_accum_type): Moved to stor-layout.h. (make_unsigned_fract_type): Moved to stor-layout.h. (make_unsigned_type): Moved to stor-layout.h. (mark_decl_referenced): Moved to varasm.h. (mark_referenced): Moved to varasm.h. (may_negate_without_overflow_p): Moved to fold-const.h. (maybe_get_identifier): Moved to stringpool.h. (merge_ranges): Moved to fold-const.h. (merge_weak): Moved to varasm.h. (mode_for_size_tree): Moved to stor-layout.h. (multiple_of_p): Moved to fold-const.h. (must_pass_in_stack_var_size): Moved to calls.h. (must_pass_in_stack_var_size_or_pad): Moved to calls.h. (native_encode_expr): Moved to fold-const.h. (native_interpret_expr): Moved to fold-const.h. (non_lvalue): Moved to fold-const.h. (non_lvalue_loc): Moved to fold-const.h. (normalize_offset): Moved to stor-layout.h. (normalize_rli): Moved to stor-layout.h. (notice_global_symbol): Moved to varasm.h. (omit_one_operand): Moved to fold-const.h. (omit_one_operand_loc): Moved to fold-const.h. (omit_two_operands): Moved to fold-const.h. (omit_two_operands_loc): Moved to fold-const.h. (operand_equal_p): Moved to tree-data-ref.h. (parse_input_constraint): Moved to stmt.h. (parse_output_constraint): Moved to stmt.h. (place_field): Moved to stor-layout.h. (pop_function_context): Moved to function.h. (pop_temp_slots): Moved to function.h. (pos_from_bit): Moved to stor-layout.h. (preserve_temp_slots): Moved to function.h. (print_node): Moved to print-tree.h. (print_node_brief): Moved to print-tree.h. (print_rtl): Moved to rtl.h. (process_pending_assemble_externals): Moved to varasm.h. (ptr_difference_const): Moved to fold-const.h. (push_function_context): Moved to function.h. (push_struct_function): Moved to function.h. (push_temp_slots): Moved to function.h. (record_tm_replacement): Moved to trans-mem.h. (relayout_decl): Moved to stor-layout.h. (resolve_asm_operand_names): Moved to stmt.h. (resolve_unique_section): Moved to varasm.h. (rli_size_so_far): Moved to stor-layout.h. (rli_size_unit_so_far): Moved to stor-layout.h. (round_down): Moved to fold-const.h. (round_down_loc): Moved to fold-const.h. (round_up): Moved to fold-const.h. (round_up_loc): Moved to fold-const.h. (set_decl_incoming_rtl): Moved to emit-rtl.h. (set_decl_rtl): Moved to tree.h. (set_min_and_max_values_for_integral_type): Moved to stor-layout.h. (set_user_assembler_name): Moved to varasm.h. (setjmp_call_p): Moved to calls.h. (size_binop): Moved to fold-const.h. (size_binop_loc): Moved to fold-const.h. (size_diffop): Moved to fold-const.h. (size_diffop_loc): Moved to fold-const.h. (size_int_kind): Moved to fold-const.h. (stack_protect_epilogue): Moved to function.h. (start_record_layout): Moved to stor-layout.h. (supports_one_only): Moved to varasm.h. (swap_tree_comparison): Moved to fold-const.h. (tm_malloc_replacement): Moved to trans-mem.h. (tree build_fold_addr_expr_loc): Moved to fold-const.h. (tree build_invariant_address): Moved to fold-const.h. (tree_binary_nonnegative_warnv_p): Moved to fold-const.h. (tree_binary_nonzero_warnv_p): Moved to fold-const.h. (tree_call_nonnegative_warnv_p): Moved to fold-const.h. (tree_expr_nonnegative_p): Moved to fold-const.h. (tree_expr_nonnegative_warnv_p): Moved to fold-const.h. (tree_output_constant_def): Moved to varasm.h. (tree_overlaps_hard_reg_set): Moved to stmt.h. (tree_single_nonnegative_warnv_p): Moved to fold-const.h. (tree_single_nonzero_warnv_p): Moved to fold-const.h. (tree_swap_operands_p): Moved to fold-const.h. (tree_unary_nonnegative_warnv_p): Moved to fold-const.h. (tree_unary_nonzero_warnv_p): Moved to fold-const.h. (update_alignment_for_field): Moved to stor-layout.h. (use_register_for_decl): Moved to function.h. (variable_size): Moved to rtl.h. (vector_type_mode): Moved to stor-layout.h. * cgraph.h: Corresponding changes. * emit-rtl.h: Corresponding changes. * expr.h: Corresponding changes. * function.h: Corresponding changes. * optabs.h: Corresponding changes. * trans-mem.h: Corresponding changes. Protect against multiple inclusion. * tree-inline.h: Corresponding changes. * tree-iterator.h: Corresponding changes. * tree-dfa.h: Include expr.h. * tree-ssanames.h: Include stringpool.h. * attribs.h: New file. * calls.h: New file. * fold-const.h: New file. * gcc-symtab.h: New file. * print-rtl.h: New file. * print-tree.h: New file. * stmt.h: New file. * stor-layout.h: New file. * strinpool.h: New file. * tree-nested.h: New file * tree-object-size.h: New file. * varasm.h: New file. * Makefile.in (PLUGIN_HEADERS): Add stringpool.h. * alias.c: Include varasm.h. Include expr.h. * asan.c: Include calls.h. Include stor-layout.h. Include varasm.h. * attribs.c: Include stringpool.h. Include attribs.h. Include stor-layout.h. * builtins.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. Include tree-object-size.h. * calls.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include attribs.h. * cfgexpand.c: Include stringpool.h. Include varasm.h. Include stor-layout.h. Include stmt.h. Include print-tree.h. * cgraph.c: Include varasm.h. Include calls.h. Include print-tree.h. * cgraphclones.c: Include stringpool.h. Include function.h. Include emit-rtl.h. Move inclusion of rtl.h earlier in the file. * cgraphunit.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. * cilk-common.c: Include stringpool.h. Include stor-layout.h. * combine.c: Include stor-layout.h. * config/aarch64/aarch64-builtins.c: Include stor-layout.h. Include stringpool.h. Include calls.h. * config/aarch64/aarch64.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/alpha/alpha.c: Include stor-layout.h. Include calls.h. Include varasm.h. * config/arc/arc.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. Include calls.h. * config/arm/arm.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/avr/avr-c.c: Include stor-layout.h. * config/avr/avr-log.c: Include print-tree.h. * config/avr/avr.c: Include print-tree.h. Include calls.h. Include stor-layout.h. Include stringpool.h. * config/bfin/bfin.c: Include varasm.h. Include calls.h. * config/c6x/c6x.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/cr16/cr16.c: Include stor-layout.h. Include calls.h. * config/cris/cris.c: Include varasm.h. Include stor-layout.h. Include calls.h. Include stmt.h. * config/darwin.c: Include stringpool.h. Include varasm.h. Include stor-layout.h. * config/epiphany/epiphany.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/fr30/fr30.c: Include stor-layout.h. Include varasm.h. * config/frv/frv.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. * config/h8300/h8300.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/i386/i386.c: Include stringpool.h. Include attribs.h. Include calls.h. Include stor-layout.h. Include varasm.h. * config/i386/winnt-cxx.c: Include stringpool.h. Include attribs.h. * config/i386/winnt.c: Include stringpool.h. Include varasm.h. * config/ia64/ia64-c.c: Include stringpool.h. * config/ia64/ia64.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/iq2000/iq2000.c: Include stor-layout.h. Include calls.h. Include varasm.h. * config/lm32/lm32.c: Include calls.h. * config/m32c/m32c.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/m32r/m32r.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include calls.h. * config/m68k/m68k.c: Include calls.h. Include stor-layout.h. Include varasm.h. * config/mcore/mcore.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include calls.h. * config/mep/mep.c: Include varasm.h. Include calls.h. Include stringpool.h. Include stor-layout.h. * config/microblaze/microblaze.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/mips/mips.c: Include varasm.h. Include stringpool.h. Include stor-layout.h. Include calls.h. * config/mmix/mmix.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/mn10300/mn10300.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/moxie/moxie.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/msp430/msp430.c: Include stor-layout.h. Include calls.h. * config/nds32/nds32.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/pa/pa.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. Include calls.h. * config/pdp11/pdp11.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/picochip/picochip.c: Include calls.h. Include stor-layout.h. Include stringpool.h. Include varasm.h. * config/rl78/rl78.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/rs6000/rs6000-c.c: Include stor-layout.h. Include stringpool.h. * config/rs6000/rs6000.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include print-tree.h. Include varasm.h. * config/rx/rx.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/s390/s390.c: Include print-tree.h. Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/score/score.c: Include stringpool.h. Include calls.h. Include varasm.h. Include stor-layout.h. * config/sh/sh-c.c: Include stringpool.h. Include attribs.h.h. * config/sh/sh.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/sol2-c.c: Include stringpool.h. Include attribs.h. * config/sol2-cxx.c: Include stringpool.h. * config/sol2.c: Include stringpool.h. Include varasm.h. * config/sparc/sparc.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/spu/spu-c.c: Include stringpool.h. * config/spu/spu.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/stormy16/stormy16.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/tilegx/tilegx.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/tilepro/tilepro.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/v850/v850-c.c: Include stringpool.h. Include attribs.h. * config/v850/v850.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/vax/vax.c: Include calls.h. Include varasm.h. * config/vms/vms.c: Include stringpool.h. * config/vxworks.c: Include stringpool.h. * config/xtensa/xtensa.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * convert.c: Include stor-layout.h. * coverage.c: Include stringpool.h. Include stor-layout.h. * dbxout.c: Include varasm.h. Include stor-layout.h. * dojump.c: Include stor-layout.h. * dse.c: Include stor-layout.h. * dwarf2asm.c: Include stringpool.h. Include varasm.h. * dwarf2cfi.c: Include stor-layout.h. * dwarf2out.c: Include rtl.h. Include stringpool.h. Include stor-layout.h. Include varasm.h. Include function.h. Include emit-rtl.h. Move inclusion of rtl.h earlier in the file. * emit-rtl.c: Include varasm.h. * except.c: Include stringpool.h. Include stor-layout.h. * explow.c: Include stor-layout.h. * expmed.c: Include stor-layout.h. * expr.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. Include varasm.h. * final.c: Include varasm.h. * fold-const.c: Include stor-layout.h. Include calls.h. Include tree-iterator.h. * function.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. * genattrtab.c (write_header): Emit includes for varasm.h, stor-layout.h and calls.h. * genautomata.c (main): Likewise. * genemit.c: Likewise. * genopinit.c: Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c: Likewise. * genpreds.c (write_insn_preds_c): Likewise. * gengtype.c (open_base_files): Add stringpool.h. * gimple-expr.c: Include stringpool.h. Include stor-layout.h. * gimple-fold.c: Include stringpool.h. Include expr.h. Include stmt.h. Include stor-layout.h. * gimple-low.c: Include tree-nested.h. Include calls.h. * gimple-pretty-print.c: Include stringpool.h. * gimple-ssa-strength-reduction.c: Include stor-layout.h. Include expr.h. * gimple-walk.c: Include stmt.h. * gimple.c: Include calls.h. Include stmt.h. Include stor-layout.h. * gimplify.c: Include stringpool.h. Include calls.h. Include varasm.h. Include stor-layout.h. Include stmt.h. Include print-tree.h. Include expr.h. * gimplify-me.c: Include stmt.h Include stor-layout.h * internal-fn.c: Include stor-layout.h. * ipa-devirt.c: Include print-tree.h. Include calls.h. * ipa-inline-analysis.c: Include stor-layout.h. Include stringpool.h. Include print-tree.h. * ipa-inline.c: Include trans-mem.h. Include calls.h. * ipa-prop.c: Include expr.h. Include stor-layout.h. Include print-tree.h. * ipa-pure-const.c: Include print-tree.h. Include calls.h. * ipa-reference.c: Include calls.h. * ipa-split.c: Include stringpool.h. Include expr.h. Include calls.h. * ipa.c: Include calls.h. Include stringpool.h. * langhooks.c: Include stringpool.h. Include attribs.h. * lto-cgraph.c: Include stringpool.h. * lto-streamer-in.c: Include stringpool.h. * lto-streamer-out.c: Include stor-layout.h. Include stringpool.h. * omp-low.c: Include stringpool.h. Include stor-layout.h. Include expr.h. * optabs.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. * passes.c: Include varasm.h. * predict.c: Include calls.h. * print-rtl.c: Include print-tree.h. * print-tree.c: Include varasm.h. Include print-rtl.h. Include stor-layout.h. * realmpfr.c: Include stor-layout.h. * reg-stack.c: Include varasm.h. * sdbout.c: Include varasm.h. Include stor-layout.h. * simplify-rtx.c: Include varasm.h. * stmt.c: Include varasm.h. Include stor-layout.h. * stor-layout.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. Include print-tree.h. * symtab.c: Include rtl.h. Include print-tree.h. Include varasm.h. Include function.h. Include emit-rtl.h. * targhooks.c: Include stor-layout.h. Include varasm.h. * toplev.c: Include varasm.h. Include tree-inline.h. * trans-mem.c: Include calls.h. Include function.h. Include rtl.h. Include emit-rtl.h. * tree-affine.c: Include expr.h. * tree-browser.c: Include print-tree.h. * tree-call-cdce.c: Include stor-layout.h. * tree-cfg.c: Include trans-mem.h. Include stor-layout.h. Include print-tree.h. * tree-complex.c: Include stor-layout.h. * tree-data-ref.c: Include expr.h. * tree-dfa.c: Include stor-layout.h. * tree-eh.c: Include expr.h. Include calls.h. * tree-emutls.c: Include stor-layout.h. Include varasm.h. * tree-if-conv.c: Include stor-layout.h. * tree-inline.c: Include stor-layout.h. Include calls.h. * tree-loop-distribution.c: Include stor-layout.h. * tree-nested.c: Include stringpool.h. Include stor-layout.h. * tree-object-size.c: Include tree-object-size.h. * tree-outof-ssa.c: Include stor-layout.h. * tree-parloops.c: Include stor-layout.h. Include tree-nested.h. * tree-pretty-print.c: Include stor-layout.h. Include expr.h. * tree-profile.c: Include varasm.h. Include tree-nested.h. * tree-scalar-evolution.c: Include expr.h. * tree-sra.c: Include stor-layout.h. * tree-ssa-address.c: Include stor-layout.h. * tree-ssa-ccp.c: Include stor-layout.h. * tree-ssa-dce.c: Include calls.h. * tree-ssa-dom.c: Include stor-layout.h. * tree-ssa-forwprop.c: Include stor-layout.h. * tree-ssa-ifcombine.c: Include stor-layout.h. * tree-ssa-loop-ivopts.c: Include stor-layout.h. * tree-ssa-loop-niter.c: Include calls.h. Include expr.h. * tree-ssa-loop-prefetch.c: Include stor-layout.h. * tree-ssa-math-opts.c: Include stor-layout.h. * tree-ssa-operands.c: Include stmt.h. Include print-tree.h. * tree-ssa-phiopt.c: Include stor-layout.h. * tree-ssa-reassoc.c: Include stor-layout.h. * tree-ssa-sccvn.c: Include stor-layout.h. * tree-ssa-sink.c: Include stor-layout.h. * tree-ssa-strlen.c: Include stor-layout.h. * tree-ssa-structalias.c: Include stor-layout.h. Include stmt.h. * tree-ssa-tail-merge.c: Include stor-layout.h. Include trans-mem.h. * tree-ssa-uncprop.c: Include stor-layout.h. * tree-ssa.c: Include stor-layout.h. * tree-ssanames.c: Include stor-layout.h. * tree-streamer-in.c: Include stringpool.h. * tree-streamer-out.c: Include stor-layout.h. * tree-switch-conversion.c: Include varasm.h. Include stor-layout.h. * tree-tailcall.c: Include stor-layout.h. * tree-vect-data-refs.c: Include stor-layout.h. * tree-vect-generic.c: Include stor-layout.h. * tree-vect-loop.c: Include stor-layout.h. * tree-vect-patterns.c: Include stor-layout.h. * tree-vect-slp.c: Include stor-layout.h. * tree-vect-stmts.c: Include stor-layout.h. * tree-vectorizer.c: Include stor-layout.h. * tree-vrp.c: Include stor-layout.h. Include calls.h. * tree.c: Include stor-layout.h. Include calls.h. Include attribs.h. Include varasm.h. * tsan.c: Include expr.h. * ubsan.c: Include stor-layout.h. Include stringpool.h. * value-prof.c: Include tree-nested.h. Include calls.h. * var-tracking.c: Include varasm.h. Include stor-layout.h. * varasm.c: Include stor-layout.h. Include stringpool.h. Include gcc-symtab.h. Include varasm.h. * varpool.c: Include varasm.h. * vmsdbgout.c: Include varasm.h. * xcoffout.c: Include varasm.h. ada/ChangeLog * gcc-interface/decl.c: Include stringpool.h Include stor-layout.h * gcc-interface/misc.c: Include stor-layout.h Include print-tree.h * gcc-interface/trans.c: Include stringpool.h Include stor-layout.h Include stmt.h Include varasm.h * gcc-interface/utils.c: Include stringpool.h Include stor-layout.h Include attribs.h Include varasm.h * gcc-interface/utils2.c: Include stringpool.h Include stor-layout.h Include attribs.h Include varasm.h c-family/ChangeLog * c-common.c: Include fold-const.h. Include stor-layout.h. Include calls.h. Include stringpool.h. Include attribs.h. Include varasm.h. Include trans-mem.h. * c-cppbuiltin.c: Include stor-layout.h. Include stringpool.h. * c-format.c: Include stringpool.h. * c-lex.c: Include stringpool.h. Include stor-layout.h. * c-pragma.c: Include stringpool.h. Include attribs.h. Include varasm.h. Include gcc-symtab.h. * c-pretty-print.c: Include stor-layout.h. Include attribs.h. * cilk.c: Include stringpool.h. Include calls.h. c/ChangeLog * c-decl.c: Include print-tree.h. Include stor-layout.h. Include varasm.h. Include attribs.h. Include stringpool.h. * c-lang.c: Include fold-const.h. * c-parser.c: Include stringpool.h. Include attribs.h. Include stor-layout.h. Include varasm.h. Include trans-mem.h. * c-typeck.c: Include stor-layout.h. Include trans-mem.h. Include varasm.h. Include stmt.h. cp/ChangeLog * call.c: Include stor-layout.h. Include trans-mem.h. Include stringpool.h. * class.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. * cp-gimplify.c: Include stor-layout.h. * cvt.c: Include stor-layout.h. * decl.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include attribs.h. Include calls.h. * decl2.c: Include stringpool.h. Include varasm.h. Include attribs.h. Include stor-layout.h. Include calls.h. * error.c: Include stringpool.h. * except.c: Include stringpool.h. Include trans-mem.h. Include attribs.h. * init.c: Include stringpool.h. Include varasm.h. * lambda.c: Include stringpool.h. * lex.c: Include stringpool.h. * mangle.c: Include stor-layout.h. Include stringpool.h. * method.c: Include stringpool.h. Include varasm.h. * name-lookup.c: Include stringpool.h. Include print-tree.h. Include attribs.h. * optimize.c: Include stringpool.h. * parser.c: Include print-tree.h. Include stringpool.h. Include attribs.h. Include trans-mem.h. * pt.c: Include stringpool.h. Include varasm.h. Include attribs.h. Include stor-layout.h. * ptree.c: Include print-tree.h. * repo.c: Include stringpool.h. * rtti.c: Include stringpool.h. Include stor-layout.h. * semantics.c: Include stmt.h. Include varasm.h. Include stor-layout.h. Include stringpool.h. * tree.c: Include stor-layout.h. Include print-tree.h. Include tree-iterator.h. * typeck.c: Include stor-layout.h. Include varasm.h. * typeck2.c: Include stor-layout.h. Include varasm.h. * vtable-class-hierarchy.c: Include stringpool.h. Include stor-layout.h. fortran/ChangeLog * decl.c: Include stringpool.h. * iresolve.c: Include stringpool.h. * match.c: Include stringpool.h. * module.c: Include stringpool.h. * target-memory.c: Include stor-layout.h. * trans-common.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. * trans-const.c: Include stor-layout.h. * trans-decl.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include attribs.h. * trans-expr.c: Include stringpool.h. * trans-intrinsic.c: Include stringpool.h. Include tree-nested.h. Include stor-layout.h. * trans-io.c: Include stringpool.h. Include stor-layout.h. * trans-openmp.c: Include stringpool.h. * trans-stmt.c: Include stringpool.h. * trans-types.c: Include stor-layout.h. Include stringpool.h. * trans.c: Include stringpool.h. go/ChangeLog * go-backend.c: Include stor-layout.h. * go-gcc.cc: Include stringpool.h. Include stor-layout.h. Include varasm.h. * go-lang.c: Include stor-layout.h. java/ChangeLog * builtins.c: Include stor-layout.h. Include stringpool.h. * class.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. * constants.c: Include stringpool.h. Include stor-layout.h. * decl.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. * except.c: Include stringpool.h. Include stor-layout.h. * expr.c: Include stringpool.h. Include stor-layout.h. * jcf-parse.c: Include stringpool.h. * mangle.c: Include stringpool.h. * resource.c: Include stringpool.h. Include stor-layout.h. * typeck.c: Include stor-layout.h. Include stringpool.h. * verify-glue.c: Include stringpool.h. lto/ChangeLog * lto-lang.c: Include stringpool.h. Include stor-layout.h. * lto-partition.c: Include gcc-symtab.h. * lto.c: Include stor-layout.h. objc/ChangeLog * objc-act.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. * objc-encoding.c: Include stringpool.h. Include stor-layout.h. * objc-gnu-runtime-abi-01.c: Include stringpool.h. * objc-next-runtime-abi-01.c: Include stringpool.h. * objc-next-runtime-abi-02.c: Include stringpool.h. * objc-runtime-shared-support.c: Include stringpool.h. testsuite/ChangeLog * gcc.dg/plugin/selfassign.c: Include stringpool.h. * gcc.dg/plugin/start_unit_plugin.c: Likewise. From-SVN: r205023
2013-11-19 13:31:09 +01:00
#include "stor-layout.h"
#include "print-tree.h"
gimple-expr.h (create_tmp_var_name, [...]): Relocate prototypes from gimple.h. 2013-11-12 Andrew MacLeod <amacleod@redhat.com> * gimple-expr.h (create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs): Relocate prototypes from gimple.h. * gimplify.h: New File. Relocate some prototypes from gimple.h here. (gimple_predicate, enum fallback, enum gimplify_status): Relocate from gimple.h. * gimple.h: Move some prototypes to gimplify.h. (gimple_predicate, enum fallback, enum gimplify_status): Move to gimplify.h. (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Relocate from gimpify.c. * gimple-expr.c (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs) Relocate from gimplify.c. * gimplify.c (mark_addressable): Move to gimple-expr.c. (gimple_seq_add_stmt_without_update): Move to gimple.c. (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, is_gimple_reg_rhs): Move to gimple-expr.c. (should_carry_location_p): Move to gimple.c. (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Move to gimple.h. (annotate_one_with_location, annotate_all_with_location_after, annotate_all_with_location): Move to gimple.c. (compare_case_labels, sort_case_labels, preprocess_case_label_vec_for_gimple): Move to gimple.c. (rhs_predicate_for): Make static. (gimplify_assign): Relocate from gimple.c. * gimple.c (gimplify_assign): Move to gimplify.c. (gimple_seq_add_stmt_without_update, should_carry_location_p, annotate_one_with_location, annotate_all_with_location_after, annotate_all_with_location, compare_case_labels, sort_case_labels, preprocess_case_label_vec_for_gimple): Relocate from gimplify.c. * tree.h (unshare_expr, unshare_expr_without_location, mark_addressable): Move prototypes to gimplify.h. * Makefile.in (GTFILES): gimple-expr.c now has the GTY tag for tmp_var_id_num * asan.c: Include gimplify.h rather than gimple.h. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * dwarf2out.c: Dont include gimple.h. * fold-const.c: Include gimplify.h rather than gimple.h. * function.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-sese-to-poly.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa.c: Likewise. * langhooks.c: Dont include gimple.h. * loop-init.c: Include gimplify.h rather than gimple.h. * omp-low.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * targhooks.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversio: Likewise.n.c * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Include gimplify.h instead of gimple.h. * config/alpha/alpha.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * ada/gcc-interface/trans.c: Include gimplify.h. * c/c-typeck.c: Include gimplify.h. * c-family/c-common.c: Include gimplify.h. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * c-family/c-omp.c: Include gimple-expr.h instead of gimple.h. * c-family/c-ubsan.c: Don't include gimple.h. * cp/class.c: Include gimplify.h. * cp/cp-gimplify.c: Likewise. * cp/error.c: Likewise. * cp/init.c: Likewise. * cp/optimize.c: Likewise. * cp/pt.c: Likewise. * cp/semantics.c: Likewise. * cp/tree.c: Likewise. * cp/vtable-class-hierarchy.c: Likewise. * cp/decl2.c: Don't include gimple.h. * cp/except.c: Likewise. * cp/method.c: Include pointer-set.h instead of gimple.h. * fortran/f95-lang.c: Don't include gimple.h. * fortran/trans-array.c: Include gimple-expr.h instead of gimple.h. * fortran/trans.c: Likewise. * fortran/trans-decl.c: Likewise. * fortran/trans-expr.c: Include gimplify.h. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include gimplify.h. * java/java-gimplify.c: Include gimplify.h. * objc/objc-act.c: Include gimplify.h. From-SVN: r204717
2013-11-12 21:26:43 +01:00
#include "gimplify.h"
gimple-walk.h: New File. * gimple-walk.h: New File. Relocate prototypes from gimple.h. (struct walk_stmt_info): Relocate here from gimple.h. * gimple-iterator.h: New File. Relocate prototypes from gimple.h. (struct gimple_stmt_iterator_d): Relocate here from gimple.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h. * gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h. (struct walk_stmt_info): Move to gimple-walk.h. (gimple_seq_set_location): Move to gimple.c * gimple-walk.c: New File. (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Relocate here from gimple.c. * gimple-iterator.c: Include gimple-iterator.h. * gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to gimple-walk.c. (gimple_seq_set_location): Relocate from gimple.h. * tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c. * tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h. * gengtype.c (open_base_files): Add gimple-iterator.h to include list. * Makefile.in (OBJS): Add gimple-walk.o * asan.c: Update Include list as required for gimple-iterator.h and gimple-walk.h. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * vtable-verify.c: Likewise. * config/aarch64/aarch64-builtins.c: Include gimple-iterator.h. * config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h. * testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. From-SVN: r204763
2013-11-14 00:54:17 +01:00
#include "gimple-iterator.h"
gimplify-be.h: New file. * gimplify-be.h: New file. Add prototypes. * gimplify.h: Don't include gimple.h. (struct gimplify_hasher, struct gimplify_ctx, is_gimple_sizepos, gimplify_hasher::hash, gimplify_hasher::equal): Relocate from gimple.h. * gimple.h (struct gimplify_hasher, gimplify_hasher::hash, gimplify_hasher::equal, struct gimplify_ctx, is_gimple_sizepos): Move to gimplify.h. (enum gsi_iterator_update): Move to gimple-iterator.h. * gimple-iterator.h (enum gsi_iterator_update): Relocate from gimple.h. * gimplify-be.c: New File. (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Relocate from gimplify.c. * gimplify.c (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Move to gimplify-be.c. * Makefile.in (OBJS): Add gimplify-be.o * asan.c: Include only gimplify.h, gimplify-be.h, and/or gimple.h as required. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-sese-to-poly.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa.c: Likewise. * langhooks.c: Likewise. * omp-low.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * targhooks.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * c/c-typeck.c: Include only gimplify.h and gimple.h as needed. * c-family/c-common.c: Likewise. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * cp/class.c: Include only gimplify.h and gimple.h as needed. * cp/cp-gimplify.c: Likewise. * cp/error.c: Likewise. * cp/init.c: Likewise. * cp/optimize.c: Likewise. * cp/pt.c: Likewise. * cp/semantics.c: Likewise. * cp/tree.c: Likewise. * cp/vtable-class-hierarchy.c: Likewise. * fortran/trans-expr.c: Include only gimplify.h and gimple.h as needed. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include only gimplify.h and gimple.h as needed. * java/java-gimplify.c: Include only gimplify.h and gimple.h as needed. * objc/objc-act.c: Include only gimplify.h and gimple.h as needed. From-SVN: r204812
2013-11-14 20:39:38 +01:00
#include "gimplify-me.h"
gimple-walk.h: New File. * gimple-walk.h: New File. Relocate prototypes from gimple.h. (struct walk_stmt_info): Relocate here from gimple.h. * gimple-iterator.h: New File. Relocate prototypes from gimple.h. (struct gimple_stmt_iterator_d): Relocate here from gimple.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h. * gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h. (struct walk_stmt_info): Move to gimple-walk.h. (gimple_seq_set_location): Move to gimple.c * gimple-walk.c: New File. (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Relocate here from gimple.c. * gimple-iterator.c: Include gimple-iterator.h. * gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to gimple-walk.c. (gimple_seq_set_location): Relocate from gimple.h. * tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c. * tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h. * gengtype.c (open_base_files): Add gimple-iterator.h to include list. * Makefile.in (OBJS): Add gimple-walk.o * asan.c: Update Include list as required for gimple-iterator.h and gimple-walk.h. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * vtable-verify.c: Likewise. * config/aarch64/aarch64-builtins.c: Include gimple-iterator.h. * config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h. * testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. From-SVN: r204763
2013-11-14 00:54:17 +01:00
#include "gimple-walk.h"
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
#include "symbol-summary.h"
#include "ipa-prop.h"
tree-ssa.h: Remove all #include's * tree-ssa.h: Remove all #include's * gengtype.c (open_base_files): Adjust include list for gtype-desc.c. * alias.c: Move required includes from tree-ssa.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * loop-init.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * omp-low.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * targhooks.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. From-SVN: r203967
2013-10-23 14:16:58 +02:00
#include "tree-cfg.h"
#include "tree-dfa.h"
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
#include "tree-inline.h"
#include "ipa-inline.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"
#include "params.h"
#include "ipa-utils.h"
#include "dbgcnt.h"
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
#include "domwalk.h"
expr.h: Remove prototypes of functions defined in builtins.c. * expr.h: Remove prototypes of functions defined in builtins.c. * tree.h: (build_call_expr_*, build_string_literal): Add prototypes. Remove prototypes of functions defined in builtins.c. * builtins.h: Update prototype list to include all exported functions. * builtins.c: (default_libc_has_function, gnu_libc_has_function, no_c99_libc_has_function): Move to targhooks.c (build_string_literal, build_call_expr_loc_array, build_call_expr_loc_vec, build_call_expr_loc, build_call_expr): Move to tree.c. (expand_builtin_object_size, fold_builtin_object_size): Make static. * targhooks.c (default_libc_has_function, gnu_libc_has_function, no_c99_libc_has_function): Relocate from builtins.c. * tree.c: Include builtins.h. (build_call_expr_loc_array, build_call_expr_loc_vec, build_call_expr_loc, build_call_expr, build_string_literal): Relocate from builtins.c. * fold-const.h (fold_fma): Move prototype to builtins.h. * realmpfr.h (do_mpc_arg2): Move prototype to builtins.h. * fortran/trans.c (trans_runtime_error_vararg): Call fold_build_call_array_loc instead of fold_builtin_call_array. * asan.c: Include builtins.h. * cfgexpand.c: Likewise. * convert.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * lto-streamer-out.c: Likewise. * stmt.c: Likewise. * tree-inline.c: Likewise. * tree-object-size.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-streamer-in.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. c * c-decl.c: Include builtins.h. * c-parser.c: Likewise. cp * decl.c: Include builtins.h. * semantics.c: Likewise. go * go-gcc.cc: Include builtins.h. lto * lto-symtab.c: Include builtins.h. config * aarch64/aarch64.c: Include builtins.h. * alpha/alpha.c: Likewise. * arc/arc.c: Likewise. * arm/arm.c: Likewise. * avr/avr.c: Likewise. * bfin/bfin.c: Likewise. * c6x/c6x.c: Likewise. * cr16/cr16.c: Likewise. * cris/cris.c: Likewise. * epiphany/epiphany.c: Likewise. * fr30/fr30.c: Likewise. * frv/frv.c: Likewise. * h8300/h8300.c: Likewise. * i386/i386.c: Likewise. * i386/winnt.c: Likewise. * ia64/ia64.c: Likewise. * iq2000/iq2000.c: Likewise. * lm32/lm32.c: Likewise. * m32c/m32c.c: Likewise. * m32r/m32r.c: Likewise. * m68k/m68k.c: Likewise. * mcore/mcore.c: Likewise. * mep/mep.c: Likewise. * microblaze/microblaze.c: Likewise. * mips/mips.c: Likewise. * mmix/mmix.c: Likewise. * mn10300/mn10300.c: Likewise. * moxie/moxie.c: Likewise. * msp430/msp430.c: Likewise. * nds32/nds32.c: Likewise. * pa/pa.c: Likewise. * pdp11/pdp11.c: Likewise. * picochip/picochip.c: Likewise. * rl78/rl78.c: Likewise. * rs6000/rs6000.c: Likewise. * rx/rx.c: Likewise. * s390/s390.c: Likewise. * score/score.c: Likewise. * sh/sh.c: Likewise. * sparc/sparc.c: Likewise. * spu/spu.c: Likewise. * stormy16/stormy16.c: Likewise. * tilegx/tilegx.c: Likewise. * tilepro/tilepro.c: Likewise. * v850/v850.c: Likewise. * vax/vax.c: Likewise. * xtensa/xtensa.c: Likewise. From-SVN: r211145
2014-06-02 22:13:44 +02:00
#include "builtins.h"
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
/* Function summary where the parameter infos are actually stored. */
ipa_node_params_t *ipa_node_params_sum = NULL;
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
/* Vector of IPA-CP transformation data for each clone. */
vec<ipcp_transformation_summary, va_gc> *ipcp_transformations;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Vector where the parameter infos are actually stored. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
vec<ipa_edge_args, va_gc> *ipa_edge_args_vector;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
/* Traits for a hash table for reusing already existing ipa_bits. */
struct ipa_bit_ggc_hash_traits : public ggc_cache_remove <ipa_bits *>
{
typedef ipa_bits *value_type;
typedef ipa_bits *compare_type;
static hashval_t
hash (const ipa_bits *p)
{
hashval_t t = (hashval_t) p->value.to_shwi ();
return iterative_hash_host_wide_int (p->mask.to_shwi (), t);
}
static bool
equal (const ipa_bits *a, const ipa_bits *b)
{
return a->value == b->value && a->mask == b->mask;
}
static void
mark_empty (ipa_bits *&p)
{
p = NULL;
}
static bool
is_empty (const ipa_bits *p)
{
return p == NULL;
}
static bool
is_deleted (const ipa_bits *p)
{
return p == reinterpret_cast<const ipa_bits *> (1);
}
static void
mark_deleted (ipa_bits *&p)
{
p = reinterpret_cast<ipa_bits *> (1);
}
};
/* Hash table for avoid repeated allocations of equal ipa_bits. */
static GTY ((cache)) hash_table<ipa_bit_ggc_hash_traits> *ipa_bits_hash_table;
/* Traits for a hash table for reusing value_ranges used for IPA. Note that
the equiv bitmap is not hashed and is expected to be NULL. */
struct ipa_vr_ggc_hash_traits : public ggc_cache_remove <value_range *>
{
typedef value_range *value_type;
typedef value_range *compare_type;
static hashval_t
hash (const value_range *p)
{
gcc_checking_assert (!p->equiv);
hashval_t t = (hashval_t) p->type;
t = iterative_hash_expr (p->min, t);
return iterative_hash_expr (p->max, t);
}
static bool
equal (const value_range *a, const value_range *b)
{
return a->type == b->type && a->min == b->min && a->max == b->max;
}
static void
mark_empty (value_range *&p)
{
p = NULL;
}
static bool
is_empty (const value_range *p)
{
return p == NULL;
}
static bool
is_deleted (const value_range *p)
{
return p == reinterpret_cast<const value_range *> (1);
}
static void
mark_deleted (value_range *&p)
{
p = reinterpret_cast<value_range *> (1);
}
};
/* Hash table for avoid repeated allocations of equal value_ranges. */
static GTY ((cache)) hash_table<ipa_vr_ggc_hash_traits> *ipa_vr_hash_table;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Holders of ipa cgraph hooks: */
re PR middle-end/37448 (cannot compile big function) PR middle-end/37448 * ipa-reference.c (ipa_reference_local_vars_info_d, ipa_reference_global_vars_info_d, ipa_reference_local_vars_info_t, ipa_reference_global_vars_info_t, ipa_reference_vars_info_t): Move here from ipa-reference.h (node_duplication_hook_holder, node_removal_hook_holder): New. (get_reference_vars_info_from_cgraph): Rename to ... (get_reference_vars_info): ... this one, use cgraph uids. (get_local_reference_vars_info, get_global_reference_vars_info): Use cgraph instead of decl. (ipa_reference_get_read_local, ipa_reference_get_written_local): Remove. (ipa_reference_get_read_global, ipa_reference_get_not_read_global ipa_reference_get_written_global, ipa_reference_get_not_written_global): Use cgraph argument. (check_call): Simplify avail check. (scan_stmt_for_static_refs): Update. (propagate_bits): Update. (merge_callee_local_info): Remove. (init_function_info): Use cgraph nodes. (clean_function_local_data): Break out from ... (clean_function): ... here. (copy_local_bitmap, copy_global_bitmap): New functions. (duplicate_node_data, remove_node_data): New functions. (generate_summary): Register hooks; use visibility instead of master clones. (propafate): Use cgraph nodes; copy bitmap to each node in cycle. * ipa-reference.h (ipa_reference_local_vars_info_d, ipa_reference_global_vars_info_d, ipa_reference_local_vars_info_t, ipa_reference_global_vars_info_t, ipa_reference_vars_info_t): Move to ipa-reference.c (ipa_reference_get_read_local, ipa_reference_get_written_local): Remove. (ipa_reference_get_read_global, ipa_reference_get_written_global, ipa_reference_get_not_read_global, ipa_reference_get_not_written_global): Update prototype. * ipa-pure-const.c (funct_state_vec): Turn into VECtor. (init_state): Remove. (node_duplication_hook_holder, node_removal_hook_holder): New. (get_function_state, set_function_state): Use VECtor. (analyze_function): Check body availability. (add_new_function): Likewise. (duplicate_node_data, remove_node_data): New. (generate_summary): Register hooks; do not care about clones. (propafate): Do not care about clones; recursive functions are not looping. * ipa-utils.c (searchc, ipa_utils_reduced_inorder): Do not skip clones. * ipa-prop.c (edge_removal_hook_holder, node_removal_hook_holder, * edge_duplication_hook_holder, node_duplication_hook_holder): Make static. * tree-flow.h (function_ann_d): Remove reference_vars_info. * tree-ssa-opreands.c (add_call_clobber_ops, add_call_read_ops): Update call of ipa-reference accesors. From-SVN: r140463
2008-09-18 19:28:40 +02:00
static struct cgraph_edge_hook_list *edge_removal_hook_holder;
static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
static struct cgraph_node_hook_list *function_insertion_hook_holder;
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
/* Description of a reference to an IPA constant. */
struct ipa_cst_ref_desc
{
/* Edge that corresponds to the statement which took the reference. */
struct cgraph_edge *cs;
/* Linked list of duplicates created when call graph edges are cloned. */
struct ipa_cst_ref_desc *next_duplicate;
/* Number of references in IPA structures, IPA_UNDESCRIBED_USE if the value
if out of control. */
int refcount;
};
/* Allocation pool for reference descriptions. */
Add new object_allocator and clean-up allocator usage. * c-format.c (static void check_format_info_main): Use object_allocator instead of pool_allocator. (check_format_arg): Likewise. (check_format_info_main): Likewise. * alloc-pool.h (object_allocator): Add new class. (pool_allocator::initialize): Use the underlying class. (pool_allocator::allocate): Likewise. (pool_allocator::remove): Likewise. (operator new): A new generic allocator. * asan.c (struct asan_mem_ref): Remove unused members. (asan_mem_ref_new): Replace new operator with object_allocator::allocate. (free_mem_ref_resources): Change deallocation. * cfg.c (initialize_original_copy_tables): Replace pool_allocator with object_allocator. * config/sh/sh.c (add_constant): Replace new operator with object_allocator::allocate. (sh_reorg): Change call to a release method. * cselib.c (struct elt_list): Remove unused members. (new_elt_list): Replace new operator with object_allocator::allocate. (new_elt_loc_list): Likewise. (new_cselib_val): Likewise. (unchain_one_elt_list): Change delete operator with remove method. (unchain_one_elt_loc_list): Likewise. (unchain_one_value): Likewise. (cselib_finish): Release newly added static allocators. * cselib.h (struct cselib_val): Remove unused members. (struct elt_loc_list): Likewise. * df-problems.c (df_chain_alloc): Replace pool_allocator with object_allocator. * df-scan.c (struct df_scan_problem_data): Likewise. (df_scan_alloc): Likewise. * df.h (struct dataflow): Likewise. * dse.c (struct read_info_type): Likewise. (struct insn_info_type): Likewise. (struct dse_bb_info_type): Likewise. (struct group_info): Likewise. (struct deferred_change): Likewise. (get_group_info): Likewise. (delete_dead_store_insn): Likewise. (free_read_records): Likewise. (replace_read): Likewise. (check_mem_read_rtx): Likewise. (scan_insn): Likewise. (dse_step1): Likewise. (dse_step7): Likewise. * et-forest.c (struct et_occ): Remove unused members. (et_new_occ): Use allocate instead of new operator. (et_new_tree): Likewise. (et_free_tree): Call release method explicitly. (et_free_tree_force): Likewise. (et_free_pools): Likewise. (et_split): Use remove instead of delete operator. * et-forest.h (struct et_node): Remove unused members. * ipa-cp.c: Change pool_allocator to object_allocator. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ira-build.c (initiate_cost_vectors): Cast return value. (ira_allocate_cost_vector): Likewise. * ira-color.c (struct update_cost_record): Remove unused members. * lra-int.h (struct lra_live_range): Likewise. (struct lra_copy): Likewise. (struct lra_insn_reg): Likewise. * lra-lives.c (lra_live_ranges_finish): Release new static allocator. * lra.c (new_insn_reg): Replace new operator with allocate method. (free_insn_regs): Same for operator delete. (finish_insn_regs): Release new static allocator. (finish_insn_recog_data): Likewise. (lra_free_copies): Replace delete operator with remove method. (lra_create_copy): Replace operator new with allocate method. (invalidate_insn_data_regno_info): Same for remove method. * regcprop.c (struct queued_debug_insn_change): Remove unused members. (free_debug_insn_changes): Replace delete operator with remove method. (replace_oldest_value_reg): Replace operator new with allocate method. (pass_cprop_hardreg::execute): Release new static variable. * sched-deps.c (sched_deps_init): Change pool_allocator to object_allocator. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * stmt.c (expand_case): Likewise. (expand_sjlj_dispatch_table): Likewise. * tree-sra.c (struct access): Remove unused members. (struct assign_link): Likewise. (sra_deinitialize): Release newly added static pools. (create_access_1):Replace operator new with allocate method. (build_accesses_from_assign): Likewise. (create_artificial_child_access): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Change pool_allocator to object_allocator. * tree-ssa-pre.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c (allocate_vn_table): Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * var-tracking.c (onepart_pool_allocate): New function. (unshare_variable): Use the newly added function. (variable_merge_over_cur): Likewise. (variable_from_dropped): Likewise. (variable_was_changed): Likewise. (set_slot_part): Likewise. (emit_notes_for_differences_1): Likewise. (vt_finalize): Release newly added static pools. From-SVN: r225869
2015-07-16 13:26:05 +02:00
static object_allocator<ipa_cst_ref_desc> ipa_refdesc_pool
Share memory blocks between pool allocators gcc/ * Makefile.in: Add memory-block.cc (pool_allocator::initialize): Use fixed block size. (pool_allocator::release): Use memory_block_pool. (pool_allocator::allocate): Likewise. * asan.c (asan_mem_ref_pool): Adjust to use common block size in all object pools. * cfg.c (initialize_original_copy_tables): Likewise. * cselib.c (elt_list_pool, elt_loc_list_pool, cselib_val_pool): Likewise. * df-problems.c (df_chain_alloc): Likewise. * df-scan.c (df_scan_alloc): Likewise. * dse.c (cse_store_info_pool, rtx_store_info_pool, read_info_type_pool, insn_info_type_pool, bb_info_pool, group_info_pool, deferred_change_pool): Likewise. * et-forest.c (et_nodes, et_occurrences): Likewise. * ipa-cp.c (ipcp_cst_values_pool, ipcp_sources_pool, ipcp_agg_lattice_pool): Likewise. * ipa-inline-analysis.c (edge_predicate_pool): Likewise. * ipa-profile.c (histogram_pool): Likewise. * ipa-prop.c (ipa_refdesc_pool): Likewise. * ira-build.c (live_range_pool, allocno_pool, object_pool, initiate_cost_vectors, pref_pool, copy_pool): Likewise. * ira-color.c (update_cost_record_pool): Likewise. * lra-lives.c (lra_live_range_pool): Likewise. * lra.c (lra_insn_reg_pool, lra_copy_pool): Likewise. * memory-block.cc: New file. * memory-block.h: New file. * regcprop.c (queued_debug_insn_change_pool): Use common block size. * sched-deps.c (sched_deps_init): Likewise. * sel-sched-ir.c (sched_lists_pool): Likewise. * stmt.c (expand_case, expand_sjlj_dispatch_table): Likewise. * tree-sra.c (access_pool): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-pre.c (pre_expr_pool, bitmap_set_pool): Likewise. * tree-ssa-reassoc.c (operand_entry_pool): Likewise. * tree-ssa-sccvn.c (allocate_vn_table): Likewise. * tree-ssa-strlen.c (strinfo_pool): Likewise. * tree-ssa-structalias.c (variable_info_pool): Likewise. * var-tracking.c (attrs_def_pool, var_pool, valvar_pool, location_chain_pool, shared_hash_pool, loc_exp_dep_pool): Likewise. gcc/c-family/ * c-format.c (check_format_arg): Adjust to use common block size in all object pools. From-SVN: r227817
2015-09-16 02:56:54 +02:00
("IPA-PROP ref descriptions");
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
/* Return true if DECL_FUNCTION_SPECIFIC_OPTIMIZATION of the decl associated
with NODE should prevent us from analyzing it for the purposes of IPA-CP. */
static bool
ipa_func_spec_opts_forbid_analysis_p (struct cgraph_node *node)
{
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
tree fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->decl);
if (!fs_opts)
return false;
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
return !opt_for_fn (node->decl, optimize) || !opt_for_fn (node->decl, flag_ipa_cp);
}
/* Return index of the formal whose tree is PTREE in function which corresponds
to INFO. */
static int
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
ipa_get_param_decl_index_1 (vec<ipa_param_descriptor, va_gc> *descriptors,
tree ptree)
{
int i, count;
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
count = vec_safe_length (descriptors);
for (i = 0; i < count; i++)
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
if ((*descriptors)[i].decl_or_type == ptree)
return i;
return -1;
}
/* Return index of the formal whose tree is PTREE in function which corresponds
to INFO. */
int
ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
{
return ipa_get_param_decl_index_1 (info->descriptors, ptree);
}
/* Populate the param_decl field in parameter DESCRIPTORS that correspond to
NODE. */
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
static void
ipa_populate_param_decls (struct cgraph_node *node,
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec<ipa_param_descriptor, va_gc> &descriptors)
{
tree fndecl;
tree fnargs;
tree parm;
int param_num;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
fndecl = node->decl;
gcc_assert (gimple_has_body_p (fndecl));
fnargs = DECL_ARGUMENTS (fndecl);
param_num = 0;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
for (parm = fnargs; parm; parm = DECL_CHAIN (parm))
{
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
descriptors[param_num].decl_or_type = parm;
descriptors[param_num].move_cost = estimate_move_cost (TREE_TYPE (parm),
true);
param_num++;
}
}
/* Return how many formal parameters FNDECL has. */
int
ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. 2011-07-18 Martin Jambor <mjambor@suse.cz> * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. (ipcp_values_pool): Declare. (ipcp_sources_pool): Likewise. (ipcp_lattice): Changed to forward declaration. (ipa_param_descriptor): Removed fields ipcp_lattice, types and cannot_devirtualize. (ipa_node_params): New fields descriptors, lattices, known_vals, clone_for_all_contexts and node dead, removed fields params and count_scale. (ipa_set_param_count): Removed. (ipa_get_param_count): Made to work with descriptors vector. (ipa_get_param): Updated. (ipa_param_cannot_devirtualize_p): Removed. (ipa_param_types_vec_empty): Likewise. (ipa_set_param_used): New function. (ipa_get_param_used): Updated to use descriptors vector. (ipa_func_list): Removed. (ipa_init_func_list): Removed declaration. (ipa_push_func_to_list_1): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_push_func_to_list): Removed. (ipa_lattice_from_jfunc): Remove declaration. (ipa_get_jf_pass_through_result): Declare. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_get_lattice): Update. (ipa_lat_is_single_const): New function. * ipa-prop.c (ipa_push_func_to_list_1): Removed. (ipa_init_func_list): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_get_param_decl_index): Fix coding style. (count_formal_params): Removed. (count_formal_params_1): Renamed to count_formal_params. (ipa_populate_param_decls): Update to use descriptors vector. (ipa_initialize_node_params): Likewise. (visit_ref_for_mod_analysis): Use ipa_set_param_used. (ipa_analyze_params_uses): Likewise. (ipa_free_node_params_substructures): Likewise and free also lattices and known values. (duplicate_array): Removed. (ipa_edge_duplication_hook): Add the new edge to the list of edge clones. (ipa_node_duplication_hook): Update to use new lattices. (ipa_free_all_structures_after_ipa_cp): Free alloc pools. (ipa_free_all_structures_after_iinln): Likewise. (ipa_write_node_info): Update to use new lattices. (ipa_read_node_info): Likewise. (ipa_get_jf_pass_through_result): New function. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc. * ipa-cp.c: Reimplemented. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed. (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter. (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise. * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies. * doc/invoke.texi (devirt-type-list-size): Removed description. (ipa-cp-value-list-size): Added description. * testsuite/gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-2.c: Likewise. * testsuite/gcc.dg/ipa/ipa-3.c: Likewise and made functions static. * testsuite/gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-5.c: Likewise. * testsuite/gcc.dg/ipa/ipa-7.c: Likewise. * testsuite/gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipacost-1.c: Likewise. * testsuite/gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some functions. * testsuite/gcc.dg/ipa/ipcp-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-2.c: Likewise. * testsuite/gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. From-SVN: r176424
2011-07-19 00:03:39 +02:00
count_formal_params (tree fndecl)
{
tree parm;
int count = 0;
gcc_assert (gimple_has_body_p (fndecl));
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
count++;
return count;
}
/* Return the declaration of Ith formal parameter of the function corresponding
to INFO. Note there is no setter function as this array is built just once
using ipa_initialize_node_params. */
void
ipa_dump_param (FILE *file, struct ipa_node_params *info, int i)
{
fprintf (file, "param #%i", i);
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
if ((*info->descriptors)[i].decl_or_type)
{
fprintf (file, " ");
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
print_generic_expr (file, (*info->descriptors)[i].decl_or_type, 0);
}
}
/* If necessary, allocate vector of parameter descriptors in info of NODE.
Return true if they were allocated, false if not. */
static bool
ipa_alloc_node_params (struct cgraph_node *node, int param_count)
{
struct ipa_node_params *info = IPA_NODE_REF (node);
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
if (!info->descriptors && param_count)
{
vec_safe_grow_cleared (info->descriptors, param_count);
return true;
}
else
return false;
}
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
/* Initialize the ipa_node_params structure associated with NODE by counting
the function parameters, creating the descriptors and populating their
param_decls. */
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
void
ipa_initialize_node_params (struct cgraph_node *node)
{
struct ipa_node_params *info = IPA_NODE_REF (node);
if (!info->descriptors
&& ipa_alloc_node_params (node, count_formal_params (node->decl)))
ipa_populate_param_decls (node, *info->descriptors);
}
/* Print the jump functions associated with call graph edge CS to file F. */
static void
ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
{
int i, count;
count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
for (i = 0; i < count; i++)
{
struct ipa_jump_func *jump_func;
enum jump_func_type type;
jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
type = jump_func->type;
fprintf (f, " param %d: ", i);
if (type == IPA_JF_UNKNOWN)
fprintf (f, "UNKNOWN\n");
else if (type == IPA_JF_CONST)
{
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
tree val = jump_func->value.constant.value;
fprintf (f, "CONST: ");
print_generic_expr (f, val, 0);
if (TREE_CODE (val) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (val, 0)) == CONST_DECL)
{
fprintf (f, " -> ");
print_generic_expr (f, DECL_INITIAL (TREE_OPERAND (val, 0)),
0);
}
fprintf (f, "\n");
}
else if (type == IPA_JF_PASS_THROUGH)
{
fprintf (f, "PASS THROUGH: ");
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
fprintf (f, "%d, op %s",
jump_func->value.pass_through.formal_id,
tree-core.h (tree_code_name): Remove. gcc/ * tree-core.h (tree_code_name): Remove. * tree.h (get_tree_code_name): New prototype. * tree.c (tree_code_name): Make static. (get_tree_code_name): New function. (dump_tree_statistics, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, omp_clause_check_failed, tree_contains_struct_check_failed, tree_operand_check_failed): Use new wrapper get_tree_code_name instead of calling tree_code_name directly. * tree-vrp.c (dump_asserts_for): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-pretty-print.c (do_niy, dump_generic_node): Likewise. * tree-pretty-print.h (pp_unsupported_tree): Likewise. * lto-streamer-out.c (lto_write_tree, DFS_write_tree): Likewise. * tree-ssa-dom.c (print_expr_hash_elt): Likewise. * gimple-pretty-print.c (dump_unary_rhs, dump_binary_rhs, dump_ternary_rhs, dump_gimple_assign, dump_gimple_cond, dump_gimple_omp_for): Likewise. * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise. * tree-ssa-pre.c (print_pre_expr): Likewise. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise. * print-tree.c (print_node_brief, print_node): Likewise. * gimple.c (gimple_check_failed): Likewise. * lto-streamer.c (lto_tag_name, print_lto_report): Likewise. * config/frv/frv.c (frv_init_cumulative_args): Likewise. * config/mep/mep.c (mep_validate_vliw): Likewise. * config/iq2000/iq2000.c (init_cumulative_args): Likewise. * config/rs6000/rs6000.c (init_cumulative_args): Likewise. gcc/cp/ * error.c (code_to_string): Use new wrapper get_tree_code_name. * cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise. * pt.c (tsubst): Likewise. * semantics.c (cxx_eval_constant_expression, potential_constant_expression_1): Likewise. * mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates, add_substitution, find_substitution): Likewise. From-SVN: r203695
2013-10-16 12:09:17 +02:00
get_tree_code_name(jump_func->value.pass_through.operation));
if (jump_func->value.pass_through.operation != NOP_EXPR)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
fprintf (f, " ");
print_generic_expr (f,
jump_func->value.pass_through.operand, 0);
}
if (jump_func->value.pass_through.agg_preserved)
fprintf (f, ", agg_preserved");
fprintf (f, "\n");
}
else if (type == IPA_JF_ANCESTOR)
{
fprintf (f, "ANCESTOR: ");
fprintf (f, "%d, offset " HOST_WIDE_INT_PRINT_DEC,
jump_func->value.ancestor.formal_id,
jump_func->value.ancestor.offset);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (jump_func->value.ancestor.agg_preserved)
fprintf (f, ", agg_preserved");
fprintf (f, "\n");
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (jump_func->agg.items)
{
struct ipa_agg_jf_item *item;
int j;
fprintf (f, " Aggregate passed by %s:\n",
jump_func->agg.by_ref ? "reference" : "value");
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_SAFE_ELT (jump_func->agg.items, j, item)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
fprintf (f, " offset: " HOST_WIDE_INT_PRINT_DEC ", ",
item->offset);
if (TYPE_P (item->value))
fprintf (f, "clobber of " HOST_WIDE_INT_PRINT_DEC " bits",
decl.c, [...]: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ada/ * gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c-family/ * c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c/ * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/cp/ * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/objc/ * objc-encoding.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ * alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c, config/aarch64/aarch64.c, config/alpha/predicates.md, config/arm/arm.c, config/darwin.c, config/epiphany/epiphany.c, config/i386/i386.c, config/iq2000/iq2000.c, config/m32c/m32c-pragma.c, config/mep/mep-pragma.c, config/mips/mips.c, config/picochip/picochip.c, config/rs6000/rs6000.c, cppbuiltin.c, dbxout.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, fold-const.c, function.c, gimple-fold.c, godump.c, ipa-cp.c, ipa-prop.c, omp-low.c, predict.c, sdbout.c, stor-layout.c, trans-mem.c, tree-object-size.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-forwprop.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-strlen.c, tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, varasm.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. From-SVN: r204961
2013-11-18 15:52:19 +01:00
tree_to_uhwi (TYPE_SIZE (item->value)));
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
else
{
fprintf (f, "cst: ");
print_generic_expr (f, item->value, 0);
}
fprintf (f, "\n");
}
}
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
struct ipa_polymorphic_call_context *ctx
= ipa_get_ith_polymorhic_call_context (IPA_EDGE_REF (cs), i);
if (ctx && !ctx->useless_p ())
{
fprintf (f, " Context: ");
ctx->dump (dump_file);
}
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (jump_func->bits)
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
fprintf (f, " value: ");
print_hex (jump_func->bits->value, f);
fprintf (f, ", mask: ");
print_hex (jump_func->bits->mask, f);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
fprintf (f, "\n");
}
else
fprintf (f, " Unknown bits\n");
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (jump_func->m_vr)
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
{
fprintf (f, " VR ");
fprintf (f, "%s[",
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
(jump_func->m_vr->type == VR_ANTI_RANGE) ? "~" : "");
print_decs (jump_func->m_vr->min, f);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
fprintf (f, ", ");
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
print_decs (jump_func->m_vr->max, f);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
fprintf (f, "]\n");
}
else
fprintf (f, " Unknown VR\n");
}
}
/* Print the jump functions of all arguments on all call graph edges going from
NODE to file F. */
void
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node)
{
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
struct cgraph_edge *cs;
fprintf (f, " Jump functions of caller %s/%i:\n", node->name (),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
node->order);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
for (cs = node->callees; cs; cs = cs->next_callee)
{
if (!ipa_edge_args_info_available_for_edge_p (cs))
continue;
fprintf (f, " callsite %s/%i -> %s/%i : \n",
xstrdup_for_dump (node->name ()), node->order,
xstrdup_for_dump (cs->callee->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
cs->callee->order);
ipa_print_node_jump_functions_for_edge (f, cs);
}
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
for (cs = node->indirect_calls; cs; cs = cs->next_callee)
{
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
struct cgraph_indirect_call_info *ii;
if (!ipa_edge_args_info_available_for_edge_p (cs))
continue;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
ii = cs->indirect_info;
if (ii->agg_contents)
fprintf (f, " indirect %s callsite, calling param %i, "
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
"offset " HOST_WIDE_INT_PRINT_DEC ", %s",
ii->member_ptr ? "member ptr" : "aggregate",
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
ii->param_index, ii->offset,
ii->by_ref ? "by reference" : "by_value");
else
fprintf (f, " indirect %s callsite, calling param %i, "
"offset " HOST_WIDE_INT_PRINT_DEC,
ii->polymorphic ? "polymorphic" : "simple", ii->param_index,
ii->offset);
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
if (cs->call_stmt)
{
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
fprintf (f, ", for stmt ");
print_gimple_stmt (f, cs->call_stmt, 0, TDF_SLIM);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
else
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
fprintf (f, "\n");
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
if (ii->polymorphic)
ii->context.dump (f);
ipa_print_node_jump_functions_for_edge (f, cs);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
}
/* Print ipa_jump_func data structures of all nodes in the call graph to F. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
void
ipa_print_all_jump_functions (FILE *f)
{
struct cgraph_node *node;
cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.h (cgraph_maybe_hot_edge_p): Declare. * ipa-cp.c (n_cloning_candidates): New static variable. (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare. (ipcp_print_all_lattices): Improve debug output. (ipcp_cloning_candidate_p): New function. (ipcp_initialize_node_lattices): Use it. (ipcp_init_stage): Do only analyzis here; prettier debug output. (ipcp_propagate_stage): Prettier debug output. (ipcp_iterate_stage): Initialize latices here; prettier debug output. (ipcp_print_all_structures): Remove. (ipcp_need_redirect_p): Test !n_cloning_candidates. (ipcp_insert_stage): Prettier debug output; call cgraph_remove_unreachable_nodes before propagating. (pass_ipa_cp): Schedule function removal pass. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better debug output. (cgraph_maybe_hot_edge_p): Move to ... * predict.c (cgraph_maybe_hot_edge_p) ... here. * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New. (common_handle_option): Set them; enable ipa-cp when profiling. * ipa-prop.c (ipa_print_node_jump_functions): Prettier output. (ipa_print_all_jump_functions): Likewise. (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags, ipa_print_all_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. From-SVN: r139772
2008-08-29 18:41:35 +02:00
fprintf (f, "\nJump functions:\n");
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)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
ipa_print_node_jump_functions (f, node);
}
}
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
/* Set jfunc to be a know-really nothing jump function. */
static void
ipa_set_jf_unknown (struct ipa_jump_func *jfunc)
{
jfunc->type = IPA_JF_UNKNOWN;
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
jfunc->bits = NULL;
jfunc->m_vr = NULL;
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
}
/* Set JFUNC to be a copy of another jmp (to be used by jump function
combination code). The two functions will share their rdesc. */
static void
ipa_set_jf_cst_copy (struct ipa_jump_func *dst,
struct ipa_jump_func *src)
{
gcc_checking_assert (src->type == IPA_JF_CONST);
dst->type = IPA_JF_CONST;
dst->value.constant = src->value.constant;
}
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
/* Set JFUNC to be a constant jmp function. */
static void
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
ipa_set_jf_constant (struct ipa_jump_func *jfunc, tree constant,
struct cgraph_edge *cs)
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
{
jfunc->type = IPA_JF_CONST;
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
jfunc->value.constant.value = unshare_expr_without_location (constant);
if (TREE_CODE (constant) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (constant, 0)) == FUNCTION_DECL)
{
struct ipa_cst_ref_desc *rdesc;
rdesc = ipa_refdesc_pool.allocate ();
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
rdesc->cs = cs;
rdesc->next_duplicate = NULL;
rdesc->refcount = 1;
jfunc->value.constant.rdesc = rdesc;
}
else
jfunc->value.constant.rdesc = NULL;
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
}
/* Set JFUNC to be a simple pass-through jump function. */
static void
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ipa_set_jf_simple_pass_through (struct ipa_jump_func *jfunc, int formal_id,
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
bool agg_preserved)
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
{
jfunc->type = IPA_JF_PASS_THROUGH;
jfunc->value.pass_through.operand = NULL_TREE;
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = NOP_EXPR;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
jfunc->value.pass_through.agg_preserved = agg_preserved;
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
}
/* Set JFUNC to be an unary pass through jump function. */
static void
ipa_set_jf_unary_pass_through (struct ipa_jump_func *jfunc, int formal_id,
enum tree_code operation)
{
jfunc->type = IPA_JF_PASS_THROUGH;
jfunc->value.pass_through.operand = NULL_TREE;
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = operation;
jfunc->value.pass_through.agg_preserved = false;
}
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
/* Set JFUNC to be an arithmetic pass through jump function. */
static void
ipa_set_jf_arith_pass_through (struct ipa_jump_func *jfunc, int formal_id,
tree operand, enum tree_code operation)
{
jfunc->type = IPA_JF_PASS_THROUGH;
jfunc->value.pass_through.operand = unshare_expr_without_location (operand);
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
jfunc->value.pass_through.formal_id = formal_id;
jfunc->value.pass_through.operation = operation;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
jfunc->value.pass_through.agg_preserved = false;
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
}
/* Set JFUNC to be an ancestor jump function. */
static void
ipa_set_ancestor_jf (struct ipa_jump_func *jfunc, HOST_WIDE_INT offset,
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
int formal_id, bool agg_preserved)
ipa-prop.h (ipa_get_jf_known_type_offset): New function. 2012-06-03 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_known_type_offset): New function. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_constant): Likewise. (ipa_get_jf_pass_through_formal_id): Likewise. (ipa_get_jf_pass_through_operation): Likewise. (ipa_get_jf_ancestor_offset): Likewise. (ipa_get_jf_ancestor_type): Likewise. (ipa_get_jf_ancestor_formal_id): Likewise. (ipa_get_jf_member_ptr_pfn): Likewise. * ipa-prop.c (ipa_set_jf_known_type): New function. (ipa_set_jf_constant): Likewise. (ipa_set_jf_simple_pass_through): Likewise. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (fill_member_ptr_cst_jump_function): Moved up and renamed to ipa_set_jf_member_ptr_cst. (detect_type_change_1): Use the new jump function creation functions. (compute_complex_assign_jump_func): Likewise. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Likewise. (compute_pass_through_member_ptrs): Likewise. (determine_cst_member_ptr): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. * ipa-cp.c (ipa_get_jf_pass_through_result): Use jump function access functions. Incorporat NOP_EXPR and BINFO handling from its callers. (ipa_get_jf_ancestor_result): Likewise. Incorporate handling BINFOs which was in its callers. (ipa_value_from_jfunc): Use jump function access functions. Some functionality moved to functions above. (propagate_vals_accross_ancestor): Likewise. (propagate_vals_accross_pass_through): Use jump function access functions. (propagate_accross_jump_function): Likewise. * ipa-inline-analysis.c (remap_edge_change_prob): Use jump function access functions. (inline_merge_summary): Likewise. From-SVN: r188156
2012-06-04 00:10:19 +02:00
{
jfunc->type = IPA_JF_ANCESTOR;
jfunc->value.ancestor.formal_id = formal_id;
jfunc->value.ancestor.offset = offset;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
jfunc->value.ancestor.agg_preserved = agg_preserved;
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Get IPA BB information about the given BB. FBI is the context of analyzis
of this function body. */
static struct ipa_bb_info *
ipa_get_bb_info (struct ipa_func_body_info *fbi, basic_block bb)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
{
gcc_checking_assert (fbi);
return &fbi->bb_infos[bb->index];
}
/* Structure to be passed in between detect_type_change and
check_stmt_for_type_change. */
tree-ssa-ccp.c (prop_value_d): Rename to ... * tree-ssa-ccp.c (prop_value_d): Rename to ... (ccp_prop_value_t): ... this one to avoid ODR violation; update uses. * ipa-prop.c (struct type_change_info): Rename to ... (prop_type_change_info): ... this; update uses. * ggc-page.c (globals): Rename to ... (static struct ggc_globals): ... this; update uses. * tree-ssa-loop-im.c (mem_ref): Rename to ... (im_mem_ref): ... this; update uses. * ggc-common.c (loc_descriptor): Rename to ... (ggc_loc_descriptor): ... this; update uses. * lra-eliminations.c (elim_table): Rename to ... (lra_elim_table): ... this; update uses. * bitmap.c (output_info): Rename to ... (bitmap_output_info): ... this; update uses. * gcse.c (expr): Rename to ... (gcse_expr) ... this; update uses. (occr): Rename to ... (gcse_occr): .. this; update uses. * tree-ssa-copy.c (prop_value_d): Rename to ... (prop_value_t): ... this. * predict.c (block_info_def): Rename to ... (block_info): ... this; update uses. (edge_info_def): Rename to ... (edge_info): ... this; update uses. * profile.c (bb_info): Rename to ... (bb_profile_info): ... this; update uses. * alloc-pool.c (output_info): Rename to ... (pool_output_info): ... this; update uses. * ipa-cp.c (topo_info): Rename to .. (ipa_topo_info): ... this; update uses. * tree-nrv.c (nrv_data): Rename to ... (nrv_data_t): ... this; update uses. * ipa-split.c (bb_info): Rename to ... (split_bb_info): ... this one. * profile.h (edge_info): Rename to ... (edge_profile_info): ... this one; update uses. * dse.c (bb_info): Rename to ... (dse_bb_info): ... this one; update uses. * cprop.c (occr): Rename to ... (cprop_occr): ... this one; update uses. (expr): Rename to ... (cprop_expr): ... this one; update uses. From-SVN: r215480
2014-09-22 21:39:44 +02:00
struct prop_type_change_info
{
/* Offset into the object where there is the virtual method pointer we are
looking for. */
HOST_WIDE_INT offset;
/* The declaration or SSA_NAME pointer of the base that we are checking for
type change. */
tree object;
/* Set to true if dynamic type change has been detected. */
bool type_maybe_changed;
};
/* Return true if STMT can modify a virtual method table pointer.
This function makes special assumptions about both constructors and
destructors which are all the functions that are allowed to alter the VMT
pointers. It assumes that destructors begin with assignment into all VMT
pointers and that constructors essentially look in the following way:
1) The very first thing they do is that they call constructors of ancestor
sub-objects that have them.
2) Then VMT pointers of this and all its ancestors is set to new values
corresponding to the type corresponding to the constructor.
3) Only afterwards, other stuff such as constructor of member sub-objects
and the code written by the user is run. Only this may include calling
virtual functions, directly or indirectly.
There is no way to call a constructor of an ancestor sub-object in any
other way.
This means that we do not have to care whether constructors get the correct
type information because they will always change it (in fact, if we define
the type to be given by the VMT pointer, it is undefined).
The most important fact to derive from the above is that if, for some
statement in the section 3, we try to detect whether the dynamic type has
changed, we can safely ignore all calls as we examine the function body
backwards until we reach statements in section 2 because these calls cannot
be ancestor constructors or destructors (if the input is not bogus) and so
do not change the dynamic type (this holds true only for automatically
allocated objects but at the moment we devirtualize only these). We then
must detect that statements in section 2 change the dynamic type and can try
to derive the new type. That is enough and we can stop, we will never see
the calls into constructors of sub-objects in this code. Therefore we can
safely ignore all call statements that we traverse.
*/
static bool
stmt_may_be_vtbl_ptr_store (gimple *stmt)
{
if (is_gimple_call (stmt))
return false;
if (gimple_clobber_p (stmt))
return false;
else if (is_gimple_assign (stmt))
{
tree lhs = gimple_assign_lhs (stmt);
if (!AGGREGATE_TYPE_P (TREE_TYPE (lhs)))
{
if (flag_strict_aliasing
&& !POINTER_TYPE_P (TREE_TYPE (lhs)))
return false;
if (TREE_CODE (lhs) == COMPONENT_REF
&& !DECL_VIRTUAL_P (TREE_OPERAND (lhs, 1)))
return false;
/* In the future we might want to use get_base_ref_and_offset to find
if there is a field corresponding to the offset and if so, proceed
almost like if it was a component ref. */
}
}
return true;
}
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
/* Callback of walk_aliased_vdefs and a helper function for detect_type_change
to check whether a particular statement may modify the virtual table
pointerIt stores its result into DATA, which points to a
tree-ssa-ccp.c (prop_value_d): Rename to ... * tree-ssa-ccp.c (prop_value_d): Rename to ... (ccp_prop_value_t): ... this one to avoid ODR violation; update uses. * ipa-prop.c (struct type_change_info): Rename to ... (prop_type_change_info): ... this; update uses. * ggc-page.c (globals): Rename to ... (static struct ggc_globals): ... this; update uses. * tree-ssa-loop-im.c (mem_ref): Rename to ... (im_mem_ref): ... this; update uses. * ggc-common.c (loc_descriptor): Rename to ... (ggc_loc_descriptor): ... this; update uses. * lra-eliminations.c (elim_table): Rename to ... (lra_elim_table): ... this; update uses. * bitmap.c (output_info): Rename to ... (bitmap_output_info): ... this; update uses. * gcse.c (expr): Rename to ... (gcse_expr) ... this; update uses. (occr): Rename to ... (gcse_occr): .. this; update uses. * tree-ssa-copy.c (prop_value_d): Rename to ... (prop_value_t): ... this. * predict.c (block_info_def): Rename to ... (block_info): ... this; update uses. (edge_info_def): Rename to ... (edge_info): ... this; update uses. * profile.c (bb_info): Rename to ... (bb_profile_info): ... this; update uses. * alloc-pool.c (output_info): Rename to ... (pool_output_info): ... this; update uses. * ipa-cp.c (topo_info): Rename to .. (ipa_topo_info): ... this; update uses. * tree-nrv.c (nrv_data): Rename to ... (nrv_data_t): ... this; update uses. * ipa-split.c (bb_info): Rename to ... (split_bb_info): ... this one. * profile.h (edge_info): Rename to ... (edge_profile_info): ... this one; update uses. * dse.c (bb_info): Rename to ... (dse_bb_info): ... this one; update uses. * cprop.c (occr): Rename to ... (cprop_occr): ... this one; update uses. (expr): Rename to ... (cprop_expr): ... this one; update uses. From-SVN: r215480
2014-09-22 21:39:44 +02:00
prop_type_change_info structure. */
static bool
check_stmt_for_type_change (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef, void *data)
{
gimple *stmt = SSA_NAME_DEF_STMT (vdef);
tree-ssa-ccp.c (prop_value_d): Rename to ... * tree-ssa-ccp.c (prop_value_d): Rename to ... (ccp_prop_value_t): ... this one to avoid ODR violation; update uses. * ipa-prop.c (struct type_change_info): Rename to ... (prop_type_change_info): ... this; update uses. * ggc-page.c (globals): Rename to ... (static struct ggc_globals): ... this; update uses. * tree-ssa-loop-im.c (mem_ref): Rename to ... (im_mem_ref): ... this; update uses. * ggc-common.c (loc_descriptor): Rename to ... (ggc_loc_descriptor): ... this; update uses. * lra-eliminations.c (elim_table): Rename to ... (lra_elim_table): ... this; update uses. * bitmap.c (output_info): Rename to ... (bitmap_output_info): ... this; update uses. * gcse.c (expr): Rename to ... (gcse_expr) ... this; update uses. (occr): Rename to ... (gcse_occr): .. this; update uses. * tree-ssa-copy.c (prop_value_d): Rename to ... (prop_value_t): ... this. * predict.c (block_info_def): Rename to ... (block_info): ... this; update uses. (edge_info_def): Rename to ... (edge_info): ... this; update uses. * profile.c (bb_info): Rename to ... (bb_profile_info): ... this; update uses. * alloc-pool.c (output_info): Rename to ... (pool_output_info): ... this; update uses. * ipa-cp.c (topo_info): Rename to .. (ipa_topo_info): ... this; update uses. * tree-nrv.c (nrv_data): Rename to ... (nrv_data_t): ... this; update uses. * ipa-split.c (bb_info): Rename to ... (split_bb_info): ... this one. * profile.h (edge_info): Rename to ... (edge_profile_info): ... this one; update uses. * dse.c (bb_info): Rename to ... (dse_bb_info): ... this one; update uses. * cprop.c (occr): Rename to ... (cprop_occr): ... this one; update uses. (expr): Rename to ... (cprop_expr): ... this one; update uses. From-SVN: r215480
2014-09-22 21:39:44 +02:00
struct prop_type_change_info *tci = (struct prop_type_change_info *) data;
if (stmt_may_be_vtbl_ptr_store (stmt))
{
tci->type_maybe_changed = true;
return true;
}
else
return false;
}
/* See if ARG is PARAM_DECl describing instance passed by pointer
or reference in FUNCTION. Return false if the dynamic type may change
in between beggining of the function until CALL is invoked.
Generally functions are not allowed to change type of such instances,
but they call destructors. We assume that methods can not destroy the THIS
pointer. Also as a special cases, constructor and destructors may change
type of the THIS pointer. */
static bool
param_type_may_change_p (tree function, tree arg, gimple *call)
{
/* Pure functions can not do any changes on the dynamic type;
that require writting to memory. */
if (flags_from_decl_or_type (function) & (ECF_PURE | ECF_CONST))
return false;
/* We need to check if we are within inlined consturctor
or destructor (ideally we would have way to check that the
inline cdtor is actually working on ARG, but we don't have
easy tie on this, so punt on all non-pure cdtors.
We may also record the types of cdtors and once we know type
of the instance match them.
Also code unification optimizations may merge calls from
different blocks making return values unreliable. So
do nothing during late optimization. */
if (DECL_STRUCT_FUNCTION (function)->after_inlining)
return true;
if (TREE_CODE (arg) == SSA_NAME
&& SSA_NAME_IS_DEFAULT_DEF (arg)
&& TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
{
/* Normal (non-THIS) argument. */
if ((SSA_NAME_VAR (arg) != DECL_ARGUMENTS (function)
|| TREE_CODE (TREE_TYPE (function)) != METHOD_TYPE)
/* THIS pointer of an method - here we want to watch constructors
and destructors as those definitely may change the dynamic
type. */
|| (TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE
&& !DECL_CXX_CONSTRUCTOR_P (function)
&& !DECL_CXX_DESTRUCTOR_P (function)
&& (SSA_NAME_VAR (arg) == DECL_ARGUMENTS (function))))
{
/* Walk the inline stack and watch out for ctors/dtors. */
for (tree block = gimple_block (call); block && TREE_CODE (block) == BLOCK;
block = BLOCK_SUPERCONTEXT (block))
if (inlined_polymorphic_ctor_dtor_block_p (block, false))
return true;
return false;
}
}
return true;
}
/* Detect whether the dynamic type of ARG of COMP_TYPE has changed (before
callsite CALL) by looking for assignments to its virtual table pointer. If
it is, return true and fill in the jump function JFUNC with relevant type
information or set it to unknown. ARG is the object itself (not a pointer
to it, unless dereferenced). BASE is the base of the memory access as
returned by get_ref_base_and_extent, as is the offset.
This is helper function for detect_type_change and detect_type_change_ssa
that does the heavy work which is usually unnecesary. */
static bool
detect_type_change_from_memory_writes (tree arg, tree base, tree comp_type,
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gcall *call, struct ipa_jump_func *jfunc,
HOST_WIDE_INT offset)
{
tree-ssa-ccp.c (prop_value_d): Rename to ... * tree-ssa-ccp.c (prop_value_d): Rename to ... (ccp_prop_value_t): ... this one to avoid ODR violation; update uses. * ipa-prop.c (struct type_change_info): Rename to ... (prop_type_change_info): ... this; update uses. * ggc-page.c (globals): Rename to ... (static struct ggc_globals): ... this; update uses. * tree-ssa-loop-im.c (mem_ref): Rename to ... (im_mem_ref): ... this; update uses. * ggc-common.c (loc_descriptor): Rename to ... (ggc_loc_descriptor): ... this; update uses. * lra-eliminations.c (elim_table): Rename to ... (lra_elim_table): ... this; update uses. * bitmap.c (output_info): Rename to ... (bitmap_output_info): ... this; update uses. * gcse.c (expr): Rename to ... (gcse_expr) ... this; update uses. (occr): Rename to ... (gcse_occr): .. this; update uses. * tree-ssa-copy.c (prop_value_d): Rename to ... (prop_value_t): ... this. * predict.c (block_info_def): Rename to ... (block_info): ... this; update uses. (edge_info_def): Rename to ... (edge_info): ... this; update uses. * profile.c (bb_info): Rename to ... (bb_profile_info): ... this; update uses. * alloc-pool.c (output_info): Rename to ... (pool_output_info): ... this; update uses. * ipa-cp.c (topo_info): Rename to .. (ipa_topo_info): ... this; update uses. * tree-nrv.c (nrv_data): Rename to ... (nrv_data_t): ... this; update uses. * ipa-split.c (bb_info): Rename to ... (split_bb_info): ... this one. * profile.h (edge_info): Rename to ... (edge_profile_info): ... this one; update uses. * dse.c (bb_info): Rename to ... (dse_bb_info): ... this one; update uses. * cprop.c (occr): Rename to ... (cprop_occr): ... this one; update uses. (expr): Rename to ... (cprop_expr): ... this one; update uses. From-SVN: r215480
2014-09-22 21:39:44 +02:00
struct prop_type_change_info tci;
ao_ref ao;
bool entry_reached = false;
gcc_checking_assert (DECL_P (arg)
|| TREE_CODE (arg) == MEM_REF
|| handled_component_p (arg));
comp_type = TYPE_MAIN_VARIANT (comp_type);
/* Const calls cannot call virtual methods through VMT and so type changes do
not matter. */
if (!flag_devirtualize || !gimple_vuse (call)
/* Be sure expected_type is polymorphic. */
|| !comp_type
|| TREE_CODE (comp_type) != RECORD_TYPE
|| !TYPE_BINFO (TYPE_MAIN_VARIANT (comp_type))
|| !BINFO_VTABLE (TYPE_BINFO (TYPE_MAIN_VARIANT (comp_type))))
return true;
ao_ref_init (&ao, arg);
ao.base = base;
ao.offset = offset;
ao.size = POINTER_SIZE;
ao.max_size = ao.size;
tci.offset = offset;
tci.object = get_base_address (arg);
tci.type_maybe_changed = false;
walk_aliased_vdefs (&ao, gimple_vuse (call), check_stmt_for_type_change,
&tci, NULL, &entry_reached);
if (!tci.type_maybe_changed)
return false;
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipa_set_jf_unknown (jfunc);
return true;
}
/* Detect whether the dynamic type of ARG of COMP_TYPE may have changed.
If it is, return true and fill in the jump function JFUNC with relevant type
information or set it to unknown. ARG is the object itself (not a pointer
to it, unless dereferenced). BASE is the base of the memory access as
returned by get_ref_base_and_extent, as is the offset. */
static bool
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
detect_type_change (tree arg, tree base, tree comp_type, gcall *call,
struct ipa_jump_func *jfunc, HOST_WIDE_INT offset)
{
if (!flag_devirtualize)
return false;
if (TREE_CODE (base) == MEM_REF
&& !param_type_may_change_p (current_function_decl,
TREE_OPERAND (base, 0),
call))
return false;
return detect_type_change_from_memory_writes (arg, base, comp_type,
call, jfunc, offset);
}
/* Like detect_type_change but ARG is supposed to be a non-dereferenced pointer
SSA name (its dereference will become the base and the offset is assumed to
be zero). */
static bool
detect_type_change_ssa (tree arg, tree comp_type,
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gcall *call, struct ipa_jump_func *jfunc)
{
gcc_checking_assert (TREE_CODE (arg) == SSA_NAME);
if (!flag_devirtualize
|| !POINTER_TYPE_P (TREE_TYPE (arg)))
return false;
if (!param_type_may_change_p (current_function_decl, arg, call))
return false;
arg = build2 (MEM_REF, ptr_type_node, arg,
build_int_cst (ptr_type_node, 0));
return detect_type_change_from_memory_writes (arg, arg, comp_type,
call, jfunc, 0);
}
/* Callback of walk_aliased_vdefs. Flags that it has been invoked to the
boolean variable pointed to by DATA. */
static bool
mark_modified (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef ATTRIBUTE_UNUSED,
void *data)
{
bool *b = (bool *) data;
*b = true;
return true;
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Return true if we have already walked so many statements in AA that we
should really just start giving up. */
static bool
aa_overwalked (struct ipa_func_body_info *fbi)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
{
gcc_checking_assert (fbi);
return fbi->aa_walked > (unsigned) PARAM_VALUE (PARAM_IPA_MAX_AA_STEPS);
}
/* Find the nearest valid aa status for parameter specified by INDEX that
dominates BB. */
static struct ipa_param_aa_status *
find_dominating_aa_status (struct ipa_func_body_info *fbi, basic_block bb,
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int index)
{
while (true)
{
bb = get_immediate_dominator (CDI_DOMINATORS, bb);
if (!bb)
return NULL;
struct ipa_bb_info *bi = ipa_get_bb_info (fbi, bb);
if (!bi->param_aa_statuses.is_empty ()
&& bi->param_aa_statuses[index].valid)
return &bi->param_aa_statuses[index];
}
}
/* Get AA status structure for the given BB and parameter with INDEX. Allocate
structures and/or intialize the result with a dominating description as
necessary. */
static struct ipa_param_aa_status *
parm_bb_aa_status_for_bb (struct ipa_func_body_info *fbi, basic_block bb,
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int index)
{
gcc_checking_assert (fbi);
struct ipa_bb_info *bi = ipa_get_bb_info (fbi, bb);
if (bi->param_aa_statuses.is_empty ())
bi->param_aa_statuses.safe_grow_cleared (fbi->param_count);
struct ipa_param_aa_status *paa = &bi->param_aa_statuses[index];
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
if (!paa->valid)
{
gcc_checking_assert (!paa->parm_modified
&& !paa->ref_modified
&& !paa->pt_modified);
struct ipa_param_aa_status *dom_paa;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
dom_paa = find_dominating_aa_status (fbi, bb, index);
if (dom_paa)
*paa = *dom_paa;
else
paa->valid = true;
}
return paa;
}
/* Return true if a load from a formal parameter PARM_LOAD is known to retrieve
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
a value known not to be modified in this function before reaching the
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
statement STMT. FBI holds information about the function we have so far
gathered but do not survive the summary building stage. */
static bool
parm_preserved_before_stmt_p (struct ipa_func_body_info *fbi, int index,
gimple *stmt, tree parm_load)
{
struct ipa_param_aa_status *paa;
bool modified = false;
ao_ref refd;
tree base = get_base_address (parm_load);
gcc_assert (TREE_CODE (base) == PARM_DECL);
if (TREE_READONLY (base))
return true;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* FIXME: FBI can be NULL if we are being called from outside
ipa_node_analysis or ipcp_transform_function, which currently happens
during inlining analysis. It would be great to extend fbi's lifetime and
always have it. Currently, we are just not afraid of too much walking in
that case. */
if (fbi)
{
if (aa_overwalked (fbi))
return false;
paa = parm_bb_aa_status_for_bb (fbi, gimple_bb (stmt), index);
if (paa->parm_modified)
return false;
}
else
paa = NULL;
gcc_checking_assert (gimple_vuse (stmt) != NULL_TREE);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ao_ref_init (&refd, parm_load);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int walked = walk_aliased_vdefs (&refd, gimple_vuse (stmt), mark_modified,
&modified, NULL);
if (fbi)
fbi->aa_walked += walked;
if (paa && modified)
paa->parm_modified = true;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return !modified;
}
/* If STMT is an assignment that loads a value from an parameter declaration,
return the index of the parameter in ipa_node_params which has not been
modified. Otherwise return -1. */
static int
load_from_unmodified_param (struct ipa_func_body_info *fbi,
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt)
{
int index;
tree op1;
if (!gimple_assign_single_p (stmt))
return -1;
op1 = gimple_assign_rhs1 (stmt);
if (TREE_CODE (op1) != PARM_DECL)
return -1;
index = ipa_get_param_decl_index_1 (descriptors, op1);
if (index < 0
|| !parm_preserved_before_stmt_p (fbi, index, stmt, op1))
return -1;
return index;
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Return true if memory reference REF (which must be a load through parameter
with INDEX) loads data that are known to be unmodified in this function
before reaching statement STMT. */
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
static bool
parm_ref_data_preserved_p (struct ipa_func_body_info *fbi,
int index, gimple *stmt, tree ref)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
struct ipa_param_aa_status *paa;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
bool modified = false;
ao_ref refd;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* FIXME: FBI can be NULL if we are being called from outside
ipa_node_analysis or ipcp_transform_function, which currently happens
during inlining analysis. It would be great to extend fbi's lifetime and
always have it. Currently, we are just not afraid of too much walking in
that case. */
if (fbi)
{
if (aa_overwalked (fbi))
return false;
paa = parm_bb_aa_status_for_bb (fbi, gimple_bb (stmt), index);
if (paa->ref_modified)
return false;
}
else
paa = NULL;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
gcc_checking_assert (gimple_vuse (stmt));
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ao_ref_init (&refd, ref);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int walked = walk_aliased_vdefs (&refd, gimple_vuse (stmt), mark_modified,
&modified, NULL);
if (fbi)
fbi->aa_walked += walked;
if (paa && modified)
paa->ref_modified = true;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return !modified;
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Return true if the data pointed to by PARM (which is a parameter with INDEX)
is known to be unmodified in this function before reaching call statement
CALL into which it is passed. FBI describes the function body. */
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
static bool
parm_ref_data_pass_through_p (struct ipa_func_body_info *fbi, int index,
gimple *call, tree parm)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
bool modified = false;
ao_ref refd;
/* It's unnecessary to calculate anything about memory contnets for a const
function because it is not goin to use it. But do not cache the result
either. Also, no such calculations for non-pointers. */
if (!gimple_vuse (call)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
|| !POINTER_TYPE_P (TREE_TYPE (parm))
|| aa_overwalked (fbi))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return false;
struct ipa_param_aa_status *paa = parm_bb_aa_status_for_bb (fbi,
gimple_bb (call),
index);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
if (paa->pt_modified)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return false;
ao_ref_init_from_ptr_and_size (&refd, parm, NULL_TREE);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int walked = walk_aliased_vdefs (&refd, gimple_vuse (call), mark_modified,
&modified, NULL);
fbi->aa_walked += walked;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (modified)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
paa->pt_modified = true;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return !modified;
}
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
/* Return true if we can prove that OP is a memory reference loading
data from an aggregate passed as a parameter.
The function works in two modes. If GUARANTEED_UNMODIFIED is NULL, it return
false if it cannot prove that the value has not been modified before the
load in STMT. If GUARANTEED_UNMODIFIED is not NULL, it will return true even
if it cannot prove the value has not been modified, in that case it will
store false to *GUARANTEED_UNMODIFIED, otherwise it will store true there.
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
INFO and PARMS_AINFO describe parameters of the current function (but the
latter can be NULL), STMT is the load statement. If function returns true,
*INDEX_P, *OFFSET_P and *BY_REF is filled with the parameter index, offset
within the aggregate and whether it is a load from a value passed by
reference respectively. */
bool
ipa_load_from_parm_agg (struct ipa_func_body_info *fbi,
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt, tree op, int *index_p,
HOST_WIDE_INT *offset_p, HOST_WIDE_INT *size_p,
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
bool *by_ref_p, bool *guaranteed_unmodified)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
int index;
HOST_WIDE_INT size, max_size;
bool reverse;
tree base
= get_ref_base_and_extent (op, offset_p, &size, &max_size, &reverse);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (max_size == -1 || max_size != size || *offset_p < 0)
return false;
if (DECL_P (base))
{
int index = ipa_get_param_decl_index_1 (descriptors, base);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (index >= 0
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
&& parm_preserved_before_stmt_p (fbi, index, stmt, op))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
*index_p = index;
*by_ref_p = false;
if (size_p)
*size_p = size;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
if (guaranteed_unmodified)
*guaranteed_unmodified = true;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return true;
}
return false;
}
if (TREE_CODE (base) != MEM_REF
|| TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME
|| !integer_zerop (TREE_OPERAND (base, 1)))
return false;
if (SSA_NAME_IS_DEFAULT_DEF (TREE_OPERAND (base, 0)))
{
tree parm = SSA_NAME_VAR (TREE_OPERAND (base, 0));
index = ipa_get_param_decl_index_1 (descriptors, parm);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
else
{
/* This branch catches situations where a pointer parameter is not a
gimple register, for example:
void hip7(S*) (struct S * p)
{
void (*<T2e4>) (struct S *) D.1867;
struct S * p.1;
<bb 2>:
p.1_1 = p;
D.1867_2 = p.1_1->f;
D.1867_2 ();
gdp = &p;
*/
gimple *def = SSA_NAME_DEF_STMT (TREE_OPERAND (base, 0));
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
index = load_from_unmodified_param (fbi, descriptors, def);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
if (index >= 0)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
bool data_preserved = parm_ref_data_preserved_p (fbi, index, stmt, op);
if (!data_preserved && !guaranteed_unmodified)
return false;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
*index_p = index;
*by_ref_p = true;
if (size_p)
*size_p = size;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
if (guaranteed_unmodified)
*guaranteed_unmodified = data_preserved;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return true;
}
return false;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
/* Given that an actual argument is an SSA_NAME (given in NAME) and is a result
of an assignment statement STMT, try to determine whether we are actually
handling any of the following cases and construct an appropriate jump
function into JFUNC if so:
1) The passed value is loaded from a formal parameter which is not a gimple
register (most probably because it is addressable, the value has to be
scalar) and we can guarantee the value has not changed. This case can
therefore be described by a simple pass-through jump function. For example:
foo (int a)
{
int a.0;
a.0_2 = a;
bar (a.0_2);
2) The passed value can be described by a simple arithmetic pass-through
jump function. E.g.
foo (int a)
{
int D.2064;
D.2064_4 = a.1(D) + 4;
bar (D.2064_4);
This case can also occur in combination of the previous one, e.g.:
foo (int a, int z)
{
int a.0;
int D.2064;
a.0_3 = a;
D.2064_4 = a.0_3 + 4;
foo (D.2064_4);
3) The passed value is an address of an object within another one (which
also passed by reference). Such situations are described by an ancestor
jump function and describe situations such as:
B::foo() (struct B * const this)
{
struct A * D.1845;
D.1845_2 = &this_1(D)->D.1748;
A::bar (D.1845_2);
INFO is the structure describing individual parameters access different
stages of IPA optimizations. PARMS_AINFO contains the information that is
only needed for intraprocedural analysis. */
static void
compute_complex_assign_jump_func (struct ipa_func_body_info *fbi,
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_node_params *info,
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct ipa_jump_func *jfunc,
gcall *call, gimple *stmt, tree name,
tree param_type)
{
HOST_WIDE_INT offset, size, max_size;
tree op1, tc_ssa, base, ssa;
bool reverse;
int index;
op1 = gimple_assign_rhs1 (stmt);
if (TREE_CODE (op1) == SSA_NAME)
{
if (SSA_NAME_IS_DEFAULT_DEF (op1))
index = ipa_get_param_decl_index (info, SSA_NAME_VAR (op1));
else
index = load_from_unmodified_param (fbi, info->descriptors,
SSA_NAME_DEF_STMT (op1));
tc_ssa = op1;
}
else
{
index = load_from_unmodified_param (fbi, info->descriptors, stmt);
tc_ssa = gimple_assign_lhs (stmt);
}
if (index >= 0)
{
switch (gimple_assign_rhs_class (stmt))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
case GIMPLE_BINARY_RHS:
{
tree op2 = gimple_assign_rhs2 (stmt);
if (!is_gimple_ip_invariant (op2)
|| ((TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
!= tcc_comparison)
&& !useless_type_conversion_p (TREE_TYPE (name),
TREE_TYPE (op1))))
return;
ipa_set_jf_arith_pass_through (jfunc, index, op2,
gimple_assign_rhs_code (stmt));
break;
}
case GIMPLE_SINGLE_RHS:
{
bool agg_p = parm_ref_data_pass_through_p (fbi, index, call,
tc_ssa);
ipa_set_jf_simple_pass_through (jfunc, index, agg_p);
break;
}
case GIMPLE_UNARY_RHS:
if (is_gimple_assign (stmt)
&& gimple_assign_rhs_class (stmt) == GIMPLE_UNARY_RHS
&& ! CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)))
ipa_set_jf_unary_pass_through (jfunc, index,
gimple_assign_rhs_code (stmt));
default:;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
return;
}
if (TREE_CODE (op1) != ADDR_EXPR)
return;
op1 = TREE_OPERAND (op1, 0);
if (TREE_CODE (TREE_TYPE (op1)) != RECORD_TYPE)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
return;
base = get_ref_base_and_extent (op1, &offset, &size, &max_size, &reverse);
if (TREE_CODE (base) != MEM_REF
/* If this is a varying address, punt. */
|| max_size == -1
|| max_size != size)
return;
2014-05-06 18:25:05 +02:00
offset += mem_ref_offset (base).to_short_addr () * BITS_PER_UNIT;
ssa = TREE_OPERAND (base, 0);
if (TREE_CODE (ssa) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (ssa)
|| offset < 0)
return;
/* Dynamic types are changed in constructors and destructors. */
index = ipa_get_param_decl_index (info, SSA_NAME_VAR (ssa));
if (index >= 0 && param_type && POINTER_TYPE_P (param_type))
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_ancestor_jf (jfunc, offset, index,
parm_ref_data_pass_through_p (fbi, index, call, ssa));
}
/* Extract the base, offset and MEM_REF expression from a statement ASSIGN if
it looks like:
iftmp.1_3 = &obj_2(D)->D.1762;
The base of the MEM_REF must be a default definition SSA NAME of a
parameter. Return NULL_TREE if it looks otherwise. If case of success, the
whole MEM_REF expression is returned and the offset calculated from any
handled components and the MEM_REF itself is stored into *OFFSET. The whole
RHS stripped off the ADDR_EXPR is stored into *OBJ_P. */
static tree
get_ancestor_addr_info (gimple *assign, tree *obj_p, HOST_WIDE_INT *offset)
{
HOST_WIDE_INT size, max_size;
tree expr, parm, obj;
bool reverse;
if (!gimple_assign_single_p (assign))
return NULL_TREE;
expr = gimple_assign_rhs1 (assign);
if (TREE_CODE (expr) != ADDR_EXPR)
return NULL_TREE;
expr = TREE_OPERAND (expr, 0);
obj = expr;
expr = get_ref_base_and_extent (expr, offset, &size, &max_size, &reverse);
if (TREE_CODE (expr) != MEM_REF
/* If this is a varying address, punt. */
|| max_size == -1
|| max_size != size
|| *offset < 0)
return NULL_TREE;
parm = TREE_OPERAND (expr, 0);
if (TREE_CODE (parm) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (parm)
|| TREE_CODE (SSA_NAME_VAR (parm)) != PARM_DECL)
return NULL_TREE;
2014-05-06 18:25:05 +02:00
*offset += mem_ref_offset (expr).to_short_addr () * BITS_PER_UNIT;
*obj_p = obj;
return expr;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
/* Given that an actual argument is an SSA_NAME that is a result of a phi
statement PHI, try to find out whether NAME is in fact a
multiple-inheritance typecast from a descendant into an ancestor of a formal
parameter and thus can be described by an ancestor jump function and if so,
write the appropriate function into JFUNC.
Essentially we want to match the following pattern:
if (obj_2(D) != 0B)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
iftmp.1_3 = &obj_2(D)->D.1762;
<bb 4>:
# iftmp.1_1 = PHI <iftmp.1_3(3), 0B(2)>
D.1879_6 = middleman_1 (iftmp.1_1, i_5(D));
return D.1879_6; */
static void
compute_complex_ancestor_jump_func (struct ipa_func_body_info *fbi,
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_node_params *info,
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct ipa_jump_func *jfunc,
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gcall *call, gphi *phi)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
HOST_WIDE_INT offset;
gimple *assign, *cond;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
basic_block phi_bb, assign_bb, cond_bb;
tree tmp, parm, expr, obj;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
int index, i;
if (gimple_phi_num_args (phi) != 2)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
return;
if (integer_zerop (PHI_ARG_DEF (phi, 1)))
tmp = PHI_ARG_DEF (phi, 0);
else if (integer_zerop (PHI_ARG_DEF (phi, 0)))
tmp = PHI_ARG_DEF (phi, 1);
else
return;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (TREE_CODE (tmp) != SSA_NAME
|| SSA_NAME_IS_DEFAULT_DEF (tmp)
|| !POINTER_TYPE_P (TREE_TYPE (tmp))
|| TREE_CODE (TREE_TYPE (TREE_TYPE (tmp))) != RECORD_TYPE)
return;
assign = SSA_NAME_DEF_STMT (tmp);
assign_bb = gimple_bb (assign);
if (!single_pred_p (assign_bb))
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
return;
expr = get_ancestor_addr_info (assign, &obj, &offset);
if (!expr)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
return;
parm = TREE_OPERAND (expr, 0);
index = ipa_get_param_decl_index (info, SSA_NAME_VAR (parm));
if (index < 0)
return;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
cond_bb = single_pred (assign_bb);
cond = last_stmt (cond_bb);
if (!cond
|| gimple_code (cond) != GIMPLE_COND
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
|| gimple_cond_code (cond) != NE_EXPR
|| gimple_cond_lhs (cond) != parm
|| !integer_zerop (gimple_cond_rhs (cond)))
return;
phi_bb = gimple_bb (phi);
for (i = 0; i < 2; i++)
{
basic_block pred = EDGE_PRED (phi_bb, i)->src;
if (pred != assign_bb && pred != cond_bb)
return;
}
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_ancestor_jf (jfunc, offset, index,
parm_ref_data_pass_through_p (fbi, index, call, parm));
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
/* Inspect the given TYPE and return true iff it has the same structure (the
same number of fields of the same types) as a C++ member pointer. If
METHOD_PTR and DELTA are non-NULL, store the trees representing the
corresponding fields there. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static bool
type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
{
tree fld;
if (TREE_CODE (type) != RECORD_TYPE)
return false;
fld = TYPE_FIELDS (type);
if (!fld || !POINTER_TYPE_P (TREE_TYPE (fld))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
|| TREE_CODE (TREE_TYPE (TREE_TYPE (fld))) != METHOD_TYPE
|| !tree_fits_uhwi_p (DECL_FIELD_OFFSET (fld)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return false;
if (method_ptr)
*method_ptr = fld;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
fld = DECL_CHAIN (fld);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (!fld || INTEGRAL_TYPE_P (fld)
|| !tree_fits_uhwi_p (DECL_FIELD_OFFSET (fld)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return false;
if (delta)
*delta = fld;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
if (DECL_CHAIN (fld))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return false;
return true;
}
/* If RHS is an SSA_NAME and it is defined by a simple copy assign statement,
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return the rhs of its defining statement. Otherwise return RHS as it
is. */
static inline tree
get_ssa_def_if_simple_copy (tree rhs)
{
while (TREE_CODE (rhs) == SSA_NAME && !SSA_NAME_IS_DEFAULT_DEF (rhs))
{
gimple *def_stmt = SSA_NAME_DEF_STMT (rhs);
if (gimple_assign_single_p (def_stmt))
rhs = gimple_assign_rhs1 (def_stmt);
else
break;
}
return rhs;
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
/* Simple linked list, describing known contents of an aggregate beforere
call. */
struct ipa_known_agg_contents_list
{
/* Offset and size of the described part of the aggregate. */
HOST_WIDE_INT offset, size;
/* Known constant value or NULL if the contents is known to be unknown. */
tree constant;
/* Pointer to the next structure in the list. */
struct ipa_known_agg_contents_list *next;
};
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
/* Find the proper place in linked list of ipa_known_agg_contents_list
structures where to put a new one with the given LHS_OFFSET and LHS_SIZE,
unless there is a partial overlap, in which case return NULL, or such
element is already there, in which case set *ALREADY_THERE to true. */
static struct ipa_known_agg_contents_list **
get_place_in_agg_contents_list (struct ipa_known_agg_contents_list **list,
HOST_WIDE_INT lhs_offset,
HOST_WIDE_INT lhs_size,
bool *already_there)
{
struct ipa_known_agg_contents_list **p = list;
while (*p && (*p)->offset < lhs_offset)
{
if ((*p)->offset + (*p)->size > lhs_offset)
return NULL;
p = &(*p)->next;
}
if (*p && (*p)->offset < lhs_offset + lhs_size)
{
if ((*p)->offset == lhs_offset && (*p)->size == lhs_size)
/* We already know this value is subsequently overwritten with
something else. */
*already_there = true;
else
/* Otherwise this is a partial overlap which we cannot
represent. */
return NULL;
}
return p;
}
/* Build aggregate jump function from LIST, assuming there are exactly
CONST_COUNT constant entries there and that th offset of the passed argument
is ARG_OFFSET and store it into JFUNC. */
static void
build_agg_jump_func_from_list (struct ipa_known_agg_contents_list *list,
int const_count, HOST_WIDE_INT arg_offset,
struct ipa_jump_func *jfunc)
{
vec_alloc (jfunc->agg.items, const_count);
while (list)
{
if (list->constant)
{
struct ipa_agg_jf_item item;
item.offset = list->offset - arg_offset;
gcc_assert ((item.offset % BITS_PER_UNIT) == 0);
item.value = unshare_expr_without_location (list->constant);
jfunc->agg.items->quick_push (item);
}
list = list->next;
}
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
/* Traverse statements from CALL backwards, scanning whether an aggregate given
in ARG is filled in with constant values. ARG can either be an aggregate
expression or a pointer to an aggregate. ARG_TYPE is the type of the
aggregate. JFUNC is the jump function into which the constants are
subsequently stored. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static void
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
determine_locally_known_aggregate_parts (gcall *call, tree arg,
tree arg_type,
struct ipa_jump_func *jfunc)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
struct ipa_known_agg_contents_list *list = NULL;
int item_count = 0, const_count = 0;
HOST_WIDE_INT arg_offset, arg_size;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple_stmt_iterator gsi;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
tree arg_base;
bool check_ref, by_ref;
ao_ref r;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (PARAM_VALUE (PARAM_IPA_MAX_AGG_ITEMS) == 0)
return;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
/* The function operates in three stages. First, we prepare check_ref, r,
arg_base and arg_offset based on what is actually passed as an actual
argument. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (POINTER_TYPE_P (arg_type))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
by_ref = true;
if (TREE_CODE (arg) == SSA_NAME)
{
tree type_size;
if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (arg_type))))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return;
check_ref = true;
arg_base = arg;
arg_offset = 0;
type_size = TYPE_SIZE (TREE_TYPE (arg_type));
decl.c, [...]: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ada/ * gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c-family/ * c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c/ * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/cp/ * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/objc/ * objc-encoding.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ * alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c, config/aarch64/aarch64.c, config/alpha/predicates.md, config/arm/arm.c, config/darwin.c, config/epiphany/epiphany.c, config/i386/i386.c, config/iq2000/iq2000.c, config/m32c/m32c-pragma.c, config/mep/mep-pragma.c, config/mips/mips.c, config/picochip/picochip.c, config/rs6000/rs6000.c, cppbuiltin.c, dbxout.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, fold-const.c, function.c, gimple-fold.c, godump.c, ipa-cp.c, ipa-prop.c, omp-low.c, predict.c, sdbout.c, stor-layout.c, trans-mem.c, tree-object-size.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-forwprop.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-strlen.c, tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, varasm.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. From-SVN: r204961
2013-11-18 15:52:19 +01:00
arg_size = tree_to_uhwi (type_size);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ao_ref_init_from_ptr_and_size (&r, arg_base, NULL_TREE);
}
else if (TREE_CODE (arg) == ADDR_EXPR)
{
HOST_WIDE_INT arg_max_size;
bool reverse;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
arg = TREE_OPERAND (arg, 0);
arg_base = get_ref_base_and_extent (arg, &arg_offset, &arg_size,
&arg_max_size, &reverse);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (arg_max_size == -1
|| arg_max_size != arg_size
|| arg_offset < 0)
return;
if (DECL_P (arg_base))
{
check_ref = false;
ao_ref_init (&r, arg_base);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
else
return;
}
else
return;
}
else
{
HOST_WIDE_INT arg_max_size;
bool reverse;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
gcc_checking_assert (AGGREGATE_TYPE_P (TREE_TYPE (arg)));
by_ref = false;
check_ref = false;
arg_base = get_ref_base_and_extent (arg, &arg_offset, &arg_size,
&arg_max_size, &reverse);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (arg_max_size == -1
|| arg_max_size != arg_size
|| arg_offset < 0)
return;
ao_ref_init (&r, arg);
}
/* Second stage walks back the BB, looks at individual statements and as long
as it is confident of how the statements affect contents of the
aggregates, it builds a sorted linked list of ipa_agg_jf_list structures
describing it. */
gsi = gsi_for_stmt (call);
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gsi_prev (&gsi);
for (; !gsi_end_p (gsi); gsi_prev (&gsi))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
struct ipa_known_agg_contents_list *n, **p;
gimple *stmt = gsi_stmt (gsi);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
HOST_WIDE_INT lhs_offset, lhs_size, lhs_max_size;
tree lhs, rhs, lhs_base;
bool reverse;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (!stmt_may_clobber_ref_p_1 (stmt, &r))
continue;
if (!gimple_assign_single_p (stmt))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
break;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
lhs = gimple_assign_lhs (stmt);
rhs = gimple_assign_rhs1 (stmt);
if (!is_gimple_reg_type (TREE_TYPE (rhs))
|| TREE_CODE (lhs) == BIT_FIELD_REF
|| contains_bitfld_component_ref_p (lhs))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
break;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
lhs_base = get_ref_base_and_extent (lhs, &lhs_offset, &lhs_size,
&lhs_max_size, &reverse);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (lhs_max_size == -1
|| lhs_max_size != lhs_size)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
break;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (check_ref)
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (TREE_CODE (lhs_base) != MEM_REF
|| TREE_OPERAND (lhs_base, 0) != arg_base
|| !integer_zerop (TREE_OPERAND (lhs_base, 1)))
break;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
else if (lhs_base != arg_base)
{
if (DECL_P (lhs_base))
continue;
else
break;
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
bool already_there = false;
p = get_place_in_agg_contents_list (&list, lhs_offset, lhs_size,
&already_there);
if (!p)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
break;
if (already_there)
continue;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
rhs = get_ssa_def_if_simple_copy (rhs);
n = XALLOCA (struct ipa_known_agg_contents_list);
n->size = lhs_size;
n->offset = lhs_offset;
if (is_gimple_ip_invariant (rhs))
{
n->constant = rhs;
const_count++;
}
else
n->constant = NULL_TREE;
n->next = *p;
*p = n;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
item_count++;
if (const_count == PARAM_VALUE (PARAM_IPA_MAX_AGG_ITEMS)
|| item_count == 2 * PARAM_VALUE (PARAM_IPA_MAX_AGG_ITEMS))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
break;
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
/* Third stage just goes over the list and creates an appropriate vector of
ipa_agg_jf_item structures out of it, of sourse only if there are
any known constants to begin with. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (const_count)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
jfunc->agg.by_ref = by_ref;
build_agg_jump_func_from_list (list, const_count, arg_offset, jfunc);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
}
/* Return the Ith param type of callee associated with call graph
edge E. */
tree
ipa_get_callee_param_type (struct cgraph_edge *e, int i)
{
int n;
tree type = (e->callee
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
? TREE_TYPE (e->callee->decl)
: gimple_call_fntype (e->call_stmt));
tree t = TYPE_ARG_TYPES (type);
for (n = 0; n < i; n++)
{
if (!t)
break;
t = TREE_CHAIN (t);
}
if (t)
return TREE_VALUE (t);
if (!e->callee)
return NULL;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
t = DECL_ARGUMENTS (e->callee->decl);
for (n = 0; n < i; n++)
{
if (!t)
return NULL;
t = TREE_CHAIN (t);
}
if (t)
return TREE_TYPE (t);
return NULL;
}
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
/* Return ipa_bits with VALUE and MASK values, which can be either a newly
allocated structure or a previously existing one shared with other jump
functions and/or transformation summaries. */
ipa_bits *
ipa_get_ipa_bits_for_value (const widest_int &value, const widest_int &mask)
{
ipa_bits tmp;
tmp.value = value;
tmp.mask = mask;
ipa_bits **slot = ipa_bits_hash_table->find_slot (&tmp, INSERT);
if (*slot)
return *slot;
ipa_bits *res = ggc_alloc<ipa_bits> ();
res->value = value;
res->mask = mask;
*slot = res;
return res;
}
/* Assign to JF a pointer to ipa_bits structure with VALUE and MASK. Use hash
table in order to avoid creating multiple same ipa_bits structures. */
static void
ipa_set_jfunc_bits (ipa_jump_func *jf, const widest_int &value,
const widest_int &mask)
{
jf->bits = ipa_get_ipa_bits_for_value (value, mask);
}
/* Return a pointer to a value_range just like *TMP, but either find it in
ipa_vr_hash_table or allocate it in GC memory. TMP->equiv must be NULL. */
static value_range *
ipa_get_value_range (value_range *tmp)
{
value_range **slot = ipa_vr_hash_table->find_slot (tmp, INSERT);
if (*slot)
return *slot;
value_range *vr = ggc_alloc<value_range> ();
*vr = *tmp;
*slot = vr;
return vr;
}
/* Return a pointer to a value range consisting of TYPE, MIN, MAX and an empty
equiv set. Use hash table in order to avoid creating multiple same copies of
value_ranges. */
static value_range *
ipa_get_value_range (enum value_range_type type, tree min, tree max)
{
value_range tmp;
tmp.type = type;
tmp.min = min;
tmp.max = max;
tmp.equiv = NULL;
return ipa_get_value_range (&tmp);
}
/* Assign to JF a pointer to a value_range structure with TYPE, MIN and MAX and
a NULL equiv bitmap. Use hash table in order to avoid creating multiple
same value_range structures. */
static void
ipa_set_jfunc_vr (ipa_jump_func *jf, enum value_range_type type,
tree min, tree max)
{
jf->m_vr = ipa_get_value_range (type, min, max);
}
/* Assign to JF a pointer to a value_range just liek TMP but either fetch a
copy from ipa_vr_hash_table or allocate a new on in GC memory. */
static void
ipa_set_jfunc_vr (ipa_jump_func *jf, value_range *tmp)
{
jf->m_vr = ipa_get_value_range (tmp);
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
/* Compute jump function for all arguments of callsite CS and insert the
information in the jump_functions array in the ipa_edge_args corresponding
to this callsite. */
static void
ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi,
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
struct cgraph_edge *cs)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
struct ipa_node_params *info = IPA_NODE_REF (cs->caller);
struct ipa_edge_args *args = IPA_EDGE_REF (cs);
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gcall *call = cs->call_stmt;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
int n, arg_num = gimple_call_num_args (call);
bool useful_context = false;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (arg_num == 0 || args->jump_functions)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_grow_cleared (args->jump_functions, arg_num);
if (flag_devirtualize)
vec_safe_grow_cleared (args->polymorphic_call_contexts, arg_num);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (gimple_call_internal_p (call))
return;
if (ipa_func_spec_opts_forbid_analysis_p (cs->caller))
return;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
for (n = 0; n < arg_num; n++)
{
struct ipa_jump_func *jfunc = ipa_get_ith_jump_func (args, n);
tree arg = gimple_call_arg (call, n);
tree param_type = ipa_get_callee_param_type (cs, n);
if (flag_devirtualize && POINTER_TYPE_P (TREE_TYPE (arg)))
{
tree instance;
struct ipa_polymorphic_call_context context (cs->caller->decl,
arg, cs->call_stmt,
&instance);
context.get_dynamic_type (instance, arg, NULL, cs->call_stmt);
*ipa_get_ith_polymorhic_call_context (args, n) = context;
if (!context.useless_p ())
useful_context = true;
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (POINTER_TYPE_P (TREE_TYPE (arg)))
{
bool addr_nonzero = false;
bool strict_overflow = false;
if (TREE_CODE (arg) == SSA_NAME
&& param_type
&& get_ptr_nonnull (arg))
addr_nonzero = true;
else if (tree_single_nonzero_warnv_p (arg, &strict_overflow))
addr_nonzero = true;
if (addr_nonzero)
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
tree z = build_int_cst (TREE_TYPE (arg), 0);
ipa_set_jfunc_vr (jfunc, VR_ANTI_RANGE, z, z);
}
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
gcc_assert (!jfunc->m_vr);
}
else
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
{
wide_int min, max;
value_range_type type;
if (TREE_CODE (arg) == SSA_NAME
&& param_type
&& (type = get_range_info (arg, &min, &max))
&& (type == VR_RANGE || type == VR_ANTI_RANGE))
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
value_range tmpvr,resvr;
tmpvr.type = type;
tmpvr.min = wide_int_to_tree (TREE_TYPE (arg), min);
tmpvr.max = wide_int_to_tree (TREE_TYPE (arg), max);
tmpvr.equiv = NULL;
memset (&resvr, 0, sizeof (resvr));
extract_range_from_unary_expr (&resvr, NOP_EXPR, param_type,
&tmpvr, TREE_TYPE (arg));
if (resvr.type == VR_RANGE || resvr.type == VR_ANTI_RANGE)
ipa_set_jfunc_vr (jfunc, &resvr);
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
gcc_assert (!jfunc->m_vr);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
}
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
gcc_assert (!jfunc->m_vr);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
}
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
if (INTEGRAL_TYPE_P (TREE_TYPE (arg))
&& (TREE_CODE (arg) == SSA_NAME || TREE_CODE (arg) == INTEGER_CST))
{
if (TREE_CODE (arg) == SSA_NAME)
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
ipa_set_jfunc_bits (jfunc, 0,
widest_int::from (get_nonzero_bits (arg),
TYPE_SIGN (TREE_TYPE (arg))));
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
ipa_set_jfunc_bits (jfunc, wi::to_widest (arg), 0);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
}
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
else if (POINTER_TYPE_P (TREE_TYPE (arg)))
{
unsigned HOST_WIDE_INT bitpos;
unsigned align;
get_pointer_alignment_1 (arg, &align, &bitpos);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
widest_int mask
= wi::mask<widest_int>(TYPE_PRECISION (TREE_TYPE (arg)), false)
.and_not (align / BITS_PER_UNIT - 1);
widest_int value = bitpos / BITS_PER_UNIT;
ipa_set_jfunc_bits (jfunc, value, mask);
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
}
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
gcc_assert (!jfunc->bits);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
if (is_gimple_ip_invariant (arg)
tree-ssa.c (target_for_debug_bind, [...]): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P macros. * tree-ssa.c (target_for_debug_bind, verify_phi_args, ssa_undefined_value_p, maybe_optimize_var): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P macros. * tree-chkp.c (chkp_register_var_initializer, chkp_make_static_bounds, chkp_get_bounds_for_decl_addr, chkp_parse_array_and_component_ref, chkp_find_bounds_1): Likewise. * ipa-polymorphic-call.c (decl_maybe_in_construction_p): Likewise. * hsa-gen.c (get_symbol_for_decl): Likewise. * cgraphunit.c (check_global_declaration, analyze_functions, handle_alias_pairs, thunk_adjust, cgraph_node::expand_thunk): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p, canonicalize_constructor_val, gimple_get_virt_method_for_vtable): Likewise. * tree.c (set_decl_section_name, copy_node_stat, need_assembler_name_p, free_lang_data_in_decl, find_decls_types_r, merge_dllimport_decl_attributes, handle_dll_attribute, decl_init_priority_insert, auto_var_in_fn_p, array_at_struct_end_p, verify_type): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior, find_explicit_erroneous_behavior): Likewise. * sdbout.c (sdbout_toplevel_data, sdbout_late_global_decl): Likewise. * ipa.c (process_references): Likewise. * tree-chkp-opt.c (chkp_get_check_result): Likewise. * varasm.c (get_block_for_decl, use_blocks_for_decl_p, make_decl_rtl, notice_global_symbol, assemble_variable, mark_decl_referenced, build_constant_desc, output_constant_def_contents, do_assemble_alias, make_decl_one_only, default_section_type_flags, categorize_decl_for_section, default_encode_section_info): Likewise. * trans-mem.c (requires_barrier): Likewise. * gimple-expr.c (mark_addressable): Likewise. * cfgexpand.c (add_scope_conflicts_1, expand_one_var, expand_used_vars_for_block, clear_tree_used, stack_protect_decl_p, expand_debug_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * ubsan.c (instrument_bool_enum_load): Likewise. * tree-pretty-print.c (print_declaration): Likewise. * simplify-rtx.c (delegitimize_mem_from_attrs): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars): Likewise. * asan.c (asan_protect_global, instrument_derefs): Likewise. * tree-into-ssa.c (rewrite_stmt, maybe_register_def, pass_build_ssa::execute): Likewise. * var-tracking.c (var_debug_decl, track_expr_p): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost, split_address_cost): Likewise. * ipa-split.c (test_nonssa_use, consider_split, mark_nonssa_use): Likewise. * tree-inline.c (insert_debug_decl_map, remap_ssa_name, can_be_nonlocal, remap_decls, copy_debug_stmt, initialize_inlined_parameters, add_local_variables, reset_debug_binding, replace_locals_op): Likewise. * dse.c (can_escape): Likewise. * ipa-devirt.c (compare_virtual_tables, referenced_from_vtable_p): Likewise. * tree-diagnostic.c (default_tree_printer): Likewise. * tree-streamer-in.c (unpack_ts_decl_common_value_fields, unpack_ts_decl_with_vis_value_fields, lto_input_ts_decl_common_tree_pointers): Likewise. * builtins.c (builtin_save_expr, fold_builtin_expect, readonly_data_expr): Likewise. * tree-ssa-structalias.c (new_var_info, get_constraint_for_ssa_var, create_variable_info_for, set_uids_in_ptset, visit_loadstore): Likewise. * gimple-streamer-out.c (output_gimple_stmt): Likewise. * gimplify.c (force_constant_size, gimplify_bind_expr, gimplify_decl_expr, gimplify_var_or_parm_decl, gimplify_compound_lval, gimplify_init_constructor, gimplify_modify_expr, gimplify_asm_expr, gimplify_oacc_declare, gimplify_type_sizes): Likewise. * cgraphbuild.c (record_reference, record_type_list, mark_address, mark_load, mark_store, pass_build_cgraph_edges::execute): Likewise. * tree-ssa-live.c (mark_all_vars_used_1, remove_unused_scope_block_p, remove_unused_locals): Likewise. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p, ptrs_compare_unequal, ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Likewise. * function.c (instantiate_expr, instantiate_decls_1, setjmp_vars_warning, add_local_decl): Likewise. * alias.c (ao_ref_from_mem, get_alias_set, compare_base_symbol_refs): Likewise. * tree-stdarg.c (find_va_list_reference, va_list_counter_struct_op, va_list_ptr_read, va_list_ptr_write, check_all_va_list_escapes, optimize_va_list_gpr_fpr_size): Likewise. * tree-nrv.c (pass_nrv::execute): Likewise. * tsan.c (instrument_expr): Likewise. * tree-ssa-dce.c (remove_dead_stmt): Likewise. * vtable-verify.c (verify_bb_vtables): Likewise. * tree-dfa.c (ssa_default_def, set_ssa_default_def, get_ref_base_and_extent): Likewise. * toplev.c (wrapup_global_declaration_1, wrapup_global_declaration_2): Likewise. * tree-sra.c (static bool constant_decl_p, find_var_candidates, analyze_all_variable_accesses): Likewise. * tree-nested.c (get_nonlocal_debug_decl, convert_nonlocal_omp_clauses, note_nonlocal_vla_type, note_nonlocal_block_vlas, convert_nonlocal_reference_stmt, get_local_debug_decl, convert_local_omp_clauses, convert_local_reference_stmt, nesting_copy_decl, remap_vla_decls): Likewise. * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Likewise. * stmt.c (decl_overlaps_hard_reg_set_p): Likewise. * dbxout.c (dbxout_late_global_decl, dbxout_type_fields, dbxout_symbol, dbxout_common_check): Likewise. * expr.c (expand_assignment, expand_expr_real_2, expand_expr_real_1, string_constant): Likewise. * hsa.c (hsa_get_declaration_name): Likewise. * passes.c (rest_of_decl_compilation): Likewise. * tree-ssanames.c (make_ssa_name_fn): Likewise. * tree-streamer-out.c (pack_ts_decl_common_value_fields, pack_ts_decl_with_vis_value_fields, write_ts_decl_common_tree_pointers): Likewise. * stor-layout.c (place_field): Likewise. * symtab.c (symtab_node::maybe_create_reference, symtab_node::verify_base, symtab_node::make_decl_local, symtab_node::copy_visibility_from, symtab_node::can_increase_alignment_p): Likewise. * dwarf2out.c (add_var_loc_to_decl, tls_mem_loc_descriptor, decl_by_reference_p, reference_to_unused, rtl_for_decl_location, fortran_common, add_location_or_const_value_attribute, add_scalar_info, add_linkage_name, set_block_abstract_flags, local_function_static, gen_variable_die, dwarf2out_late_global_decl, optimize_one_addr_into_implicit_ptr, optimize_location_into_implicit_ptr): Likewise. * gimple-low.c (record_vars_into): Likewise. * ipa-visibility.c (update_vtable_references): Likewise. * tree-ssa-address.c (fixed_address_object_p, copy_ref_info): Likewise. * lto-streamer-out.c (tree_is_indexable, get_symbol_initial_value, DFS::DFS_write_tree_body, write_symbol): Likewise. * langhooks.c (lhd_warn_unused_global_decl, lhd_set_decl_assembler_name): Likewise. * attribs.c (decl_attributes): Likewise. * except.c (output_ttype): Likewise. * varpool.c (varpool_node::get_create, ctor_for_folding, varpool_node::assemble_decl, varpool_node::create_alias): Likewise. * fold-const.c (fold_unary_loc): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge, ipa_find_agg_cst_from_init): Likewise. * omp-low.c (expand_omp_regimplify_p, expand_omp_taskreg, expand_omp_target, lower_omp_regimplify_p, grid_reg_assignment_to_local_var_p, grid_remap_prebody_decls, find_link_var_op): Likewise. * tree-chrec.c (chrec_contains_symbols): Likewise. * tree-cfg.c (verify_address, verify_expr, verify_expr_location_1, gimple_duplicate_bb, move_stmt_op, replace_block_vars_by_duplicates, execute_fixup_cfg): Likewise. From-SVN: r240900
2016-10-09 13:19:48 +02:00
|| (VAR_P (arg)
&& is_global_var (arg)
&& TREE_READONLY (arg)))
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
ipa_set_jf_constant (jfunc, arg, cs);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
else if (!is_gimple_reg_type (TREE_TYPE (arg))
&& TREE_CODE (arg) == PARM_DECL)
{
int index = ipa_get_param_decl_index (info, arg);
gcc_assert (index >=0);
/* Aggregate passed by value, check for pass-through, otherwise we
will attempt to fill in aggregate contents later in this
for cycle. */
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
if (parm_preserved_before_stmt_p (fbi, index, call, arg))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_jf_simple_pass_through (jfunc, index, false);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
continue;
}
}
else if (TREE_CODE (arg) == SSA_NAME)
{
if (SSA_NAME_IS_DEFAULT_DEF (arg))
{
int index = ipa_get_param_decl_index (info, SSA_NAME_VAR (arg));
if (index >= 0)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
bool agg_p;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
agg_p = parm_ref_data_pass_through_p (fbi, index, call, arg);
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_jf_simple_pass_through (jfunc, index, agg_p);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
}
else
{
gimple *stmt = SSA_NAME_DEF_STMT (arg);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (is_gimple_assign (stmt))
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
compute_complex_assign_jump_func (fbi, info, jfunc,
call, stmt, arg, param_type);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
else if (gimple_code (stmt) == GIMPLE_PHI)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
compute_complex_ancestor_jump_func (fbi, info, jfunc,
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
call,
as_a <gphi *> (stmt));
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
/* If ARG is pointer, we can not use its type to determine the type of aggregate
passed (because type conversions are ignored in gimple). Usually we can
safely get type from function declaration, but in case of K&R prototypes or
variadic functions we can try our luck with type of the pointer passed.
TODO: Since we look for actual initialization of the memory object, we may better
work out the type based on the memory stores we find. */
if (!param_type)
param_type = TREE_TYPE (arg);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if ((jfunc->type != IPA_JF_PASS_THROUGH
|| !ipa_get_jf_pass_through_agg_preserved (jfunc))
&& (jfunc->type != IPA_JF_ANCESTOR
|| !ipa_get_jf_ancestor_agg_preserved (jfunc))
&& (AGGREGATE_TYPE_P (TREE_TYPE (arg))
|| POINTER_TYPE_P (param_type)))
determine_locally_known_aggregate_parts (call, arg, param_type, jfunc);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
if (!useful_context)
vec_free (args->polymorphic_call_contexts);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
/* Compute jump functions for all edges - both direct and indirect - outgoing
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
from BB. */
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
static void
ipa_compute_jump_functions_for_bb (struct ipa_func_body_info *fbi, basic_block bb)
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_bb_info *bi = ipa_get_bb_info (fbi, bb);
int i;
struct cgraph_edge *cs;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
FOR_EACH_VEC_ELT_REVERSE (bi->cg_edges, i, cs)
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct cgraph_node *callee = cs->callee;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
if (callee)
{
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
callee->ultimate_alias_target ();
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* We do not need to bother analyzing calls to unknown functions
unless they may become known during lto/whopr. */
if (!callee->definition && !flag_lto)
continue;
}
ipa_compute_jump_functions_for_edge (fbi, cs);
}
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
/* If STMT looks like a statement loading a value from a member pointer formal
parameter, return that parameter and store the offset of the field to
*OFFSET_P, if it is non-NULL. Otherwise return NULL (but *OFFSET_P still
might be clobbered). If USE_DELTA, then we look for a use of the delta
field rather than the pfn. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static tree
ipa_get_stmt_member_ptr_load_param (gimple *stmt, bool use_delta,
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
HOST_WIDE_INT *offset_p)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
tree rhs, rec, ref_field, ref_offset, fld, ptr_field, delta_field;
if (!gimple_assign_single_p (stmt))
return NULL_TREE;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
rhs = gimple_assign_rhs1 (stmt);
if (TREE_CODE (rhs) == COMPONENT_REF)
{
ref_field = TREE_OPERAND (rhs, 1);
rhs = TREE_OPERAND (rhs, 0);
}
else
ref_field = NULL_TREE;
2010-09-10 01:38:23 +02:00
if (TREE_CODE (rhs) != MEM_REF)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return NULL_TREE;
rec = TREE_OPERAND (rhs, 0);
2010-09-10 01:38:23 +02:00
if (TREE_CODE (rec) != ADDR_EXPR)
return NULL_TREE;
rec = TREE_OPERAND (rec, 0);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (TREE_CODE (rec) != PARM_DECL
|| !type_like_member_ptr_p (TREE_TYPE (rec), &ptr_field, &delta_field))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return NULL_TREE;
2010-09-10 01:38:23 +02:00
ref_offset = TREE_OPERAND (rhs, 1);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (use_delta)
fld = delta_field;
else
fld = ptr_field;
if (offset_p)
*offset_p = int_bit_position (fld);
if (ref_field)
{
if (integer_nonzerop (ref_offset))
return NULL_TREE;
return ref_field == fld ? rec : NULL_TREE;
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
else
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return tree_int_cst_equal (byte_position (fld), ref_offset) ? rec
: NULL_TREE;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
/* Returns true iff T is an SSA_NAME defined by a statement. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static bool
ipa_is_ssa_with_stmt_def (tree t)
{
if (TREE_CODE (t) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (t))
return true;
else
return false;
}
/* Find the indirect call graph edge corresponding to STMT and mark it as a
call to a parameter number PARAM_INDEX. NODE is the caller. Return the
indirect call graph edge. */
static struct cgraph_edge *
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
ipa_note_param_call (struct cgraph_node *node, int param_index,
gcall *stmt)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
struct cgraph_edge *cs;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
cs = node->get_edge (stmt);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
cs->indirect_info->param_index = param_index;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
cs->indirect_info->agg_contents = 0;
cs->indirect_info->member_ptr = 0;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
cs->indirect_info->guaranteed_unmodified = 0;
return cs;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
/* Analyze the CALL and examine uses of formal parameters of the caller NODE
(described by INFO). PARMS_AINFO is a pointer to a vector containing
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
intermediate information about each formal parameter. Currently it checks
whether the call calls a pointer that is a formal parameter and if so, the
parameter is marked with the called flag and an indirect call graph edge
describing the call is created. This is very simple for ordinary pointers
represented in SSA but not-so-nice when it comes to member pointers. The
ugly part of this function does nothing more than trying to match the
pattern of such a call. An example of such a pattern is the gimple dump
below, the call is on the last line:
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
<bb 2>:
f$__delta_5 = f.__delta;
f$__pfn_24 = f.__pfn;
or
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
<bb 2>:
2010-09-10 01:38:23 +02:00
f$__delta_5 = MEM[(struct *)&f];
f$__pfn_24 = MEM[(struct *)&f + 4B];
and a few lines below:
<bb 5>
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
D.2496_3 = (int) f$__pfn_24;
D.2497_4 = D.2496_3 & 1;
if (D.2497_4 != 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 6>:
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
D.2500_7 = (unsigned int) f$__delta_5;
D.2501_8 = &S + D.2500_7;
D.2502_9 = (int (*__vtbl_ptr_type) (void) * *) D.2501_8;
D.2503_10 = *D.2502_9;
D.2504_12 = f$__pfn_24 + -1;
D.2505_13 = (unsigned int) D.2504_12;
D.2506_14 = D.2503_10 + D.2505_13;
D.2507_15 = *D.2506_14;
iftmp.11_16 = (String:: *) D.2507_15;
<bb 7>:
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
# iftmp.11_1 = PHI <iftmp.11_16(3), f$__pfn_24(2)>
D.2500_19 = (unsigned int) f$__delta_5;
D.2508_20 = &S + D.2500_19;
D.2493_21 = iftmp.11_1 (D.2508_20, 4);
Such patterns are results of simple calls to a member pointer:
int doprinting (int (MyString::* f)(int) const)
{
MyString S ("somestring");
return (S.*f)(4);
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
Moreover, the function also looks for called pointers loaded from aggregates
passed by value or reference. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static void
ipa_analyze_indirect_call_uses (struct ipa_func_body_info *fbi, gcall *call,
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
tree target)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_node_params *info = fbi->info;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
HOST_WIDE_INT offset;
bool by_ref;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (SSA_NAME_IS_DEFAULT_DEF (target))
{
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
tree var = SSA_NAME_VAR (target);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int index = ipa_get_param_decl_index (info, var);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (index >= 0)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
ipa_note_param_call (fbi->node, index, call);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int index;
gimple *def = SSA_NAME_DEF_STMT (target);
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
bool guaranteed_unmodified;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (gimple_assign_single_p (def)
&& ipa_load_from_parm_agg (fbi, info->descriptors, def,
gimple_assign_rhs1 (def), &index, &offset,
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
NULL, &by_ref, &guaranteed_unmodified))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct cgraph_edge *cs = ipa_note_param_call (fbi->node, index, call);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
cs->indirect_info->offset = offset;
cs->indirect_info->agg_contents = 1;
cs->indirect_info->by_ref = by_ref;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
cs->indirect_info->guaranteed_unmodified = guaranteed_unmodified;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return;
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
/* Now we need to try to match the complex pattern of calling a member
pointer. */
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (gimple_code (def) != GIMPLE_PHI
|| gimple_phi_num_args (def) != 2
|| !POINTER_TYPE_P (TREE_TYPE (target))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
|| TREE_CODE (TREE_TYPE (TREE_TYPE (target))) != METHOD_TYPE)
return;
/* First, we need to check whether one of these is a load from a member
pointer that is a parameter to this function. */
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
tree n1 = PHI_ARG_DEF (def, 0);
tree n2 = PHI_ARG_DEF (def, 1);
if (!ipa_is_ssa_with_stmt_def (n1) || !ipa_is_ssa_with_stmt_def (n2))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
gimple *d1 = SSA_NAME_DEF_STMT (n1);
gimple *d2 = SSA_NAME_DEF_STMT (n2);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
tree rec;
basic_block bb, virt_bb;
basic_block join = gimple_bb (def);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if ((rec = ipa_get_stmt_member_ptr_load_param (d1, false, &offset)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (ipa_get_stmt_member_ptr_load_param (d2, false, NULL))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
bb = EDGE_PRED (join, 0)->src;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
virt_bb = gimple_bb (d2);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
else if ((rec = ipa_get_stmt_member_ptr_load_param (d2, false, &offset)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
bb = EDGE_PRED (join, 1)->src;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
virt_bb = gimple_bb (d1);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
else
return;
/* Second, we need to check that the basic blocks are laid out in the way
corresponding to the pattern. */
if (!single_pred_p (virt_bb) || !single_succ_p (virt_bb)
|| single_pred (virt_bb) != bb
|| single_succ (virt_bb) != join)
return;
/* Third, let's see that the branching is done depending on the least
significant bit of the pfn. */
gimple *branch = last_stmt (bb);
if (!branch || gimple_code (branch) != GIMPLE_COND)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
if ((gimple_cond_code (branch) != NE_EXPR
&& gimple_cond_code (branch) != EQ_EXPR)
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
|| !integer_zerop (gimple_cond_rhs (branch)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
tree cond = gimple_cond_lhs (branch);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (!ipa_is_ssa_with_stmt_def (cond))
return;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
def = SSA_NAME_DEF_STMT (cond);
if (!is_gimple_assign (def)
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
|| gimple_assign_rhs_code (def) != BIT_AND_EXPR
|| !integer_onep (gimple_assign_rhs2 (def)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
cond = gimple_assign_rhs1 (def);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (!ipa_is_ssa_with_stmt_def (cond))
return;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
def = SSA_NAME_DEF_STMT (cond);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (is_gimple_assign (def)
&& CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (def)))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
cond = gimple_assign_rhs1 (def);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (!ipa_is_ssa_with_stmt_def (cond))
return;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
def = SSA_NAME_DEF_STMT (cond);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
tree rec2;
rec2 = ipa_get_stmt_member_ptr_load_param (def,
(TARGET_PTRMEMFUNC_VBIT_LOCATION
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
== ptrmemfunc_vbit_in_delta),
NULL);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (rec != rec2)
return;
index = ipa_get_param_decl_index (info, rec);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (index >= 0
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
&& parm_preserved_before_stmt_p (fbi, index, call, rec))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct cgraph_edge *cs = ipa_note_param_call (fbi->node, index, call);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
cs->indirect_info->offset = offset;
cs->indirect_info->agg_contents = 1;
cs->indirect_info->member_ptr = 1;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
cs->indirect_info->guaranteed_unmodified = 1;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
/* Analyze a CALL to an OBJ_TYPE_REF which is passed in TARGET and if the
object referenced in the expression is a formal parameter of the caller
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
FBI->node (described by FBI->info), create a call note for the
statement. */
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
static void
ipa_analyze_virtual_call_uses (struct ipa_func_body_info *fbi,
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gcall *call, tree target)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
tree obj = OBJ_TYPE_REF_OBJECT (target);
int index;
HOST_WIDE_INT anc_offset;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (!flag_devirtualize)
return;
if (TREE_CODE (obj) != SSA_NAME)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
return;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_node_params *info = fbi->info;
if (SSA_NAME_IS_DEFAULT_DEF (obj))
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_jump_func jfunc;
if (TREE_CODE (SSA_NAME_VAR (obj)) != PARM_DECL)
return;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
anc_offset = 0;
index = ipa_get_param_decl_index (info, SSA_NAME_VAR (obj));
gcc_assert (index >= 0);
if (detect_type_change_ssa (obj, obj_type_ref_class (target),
call, &jfunc))
return;
}
else
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_jump_func jfunc;
gimple *stmt = SSA_NAME_DEF_STMT (obj);
tree expr;
expr = get_ancestor_addr_info (stmt, &obj, &anc_offset);
if (!expr)
return;
index = ipa_get_param_decl_index (info,
SSA_NAME_VAR (TREE_OPERAND (expr, 0)));
gcc_assert (index >= 0);
if (detect_type_change (obj, expr, obj_type_ref_class (target),
call, &jfunc, anc_offset))
return;
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct cgraph_edge *cs = ipa_note_param_call (fbi->node, index, call);
struct cgraph_indirect_call_info *ii = cs->indirect_info;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ii->offset = anc_offset;
decl.c, [...]: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ada/ * gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c-family/ * c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c/ * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/cp/ * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/objc/ * objc-encoding.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ * alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c, config/aarch64/aarch64.c, config/alpha/predicates.md, config/arm/arm.c, config/darwin.c, config/epiphany/epiphany.c, config/i386/i386.c, config/iq2000/iq2000.c, config/m32c/m32c-pragma.c, config/mep/mep-pragma.c, config/mips/mips.c, config/picochip/picochip.c, config/rs6000/rs6000.c, cppbuiltin.c, dbxout.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, fold-const.c, function.c, gimple-fold.c, godump.c, ipa-cp.c, ipa-prop.c, omp-low.c, predict.c, sdbout.c, stor-layout.c, trans-mem.c, tree-object-size.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-forwprop.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-strlen.c, tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, varasm.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. From-SVN: r204961
2013-11-18 15:52:19 +01:00
ii->otr_token = tree_to_uhwi (OBJ_TYPE_REF_TOKEN (target));
ii->otr_type = obj_type_ref_class (target);
ii->polymorphic = 1;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
/* Analyze a call statement CALL whether and how it utilizes formal parameters
of the caller (described by INFO). PARMS_AINFO is a pointer to a vector
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
containing intermediate information about each formal parameter. */
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
static void
ipa_analyze_call_uses (struct ipa_func_body_info *fbi, gcall *call)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
tree target = gimple_call_fn (call);
if (!target
|| (TREE_CODE (target) != SSA_NAME
&& !virtual_method_call_p (target)))
return;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct cgraph_edge *cs = fbi->node->get_edge (call);
/* If we previously turned the call into a direct call, there is
no need to analyze. */
if (cs && !cs->indirect_unknown_callee)
Makefile.in (INTERNAL_FN_DEF, [...]): Define. gcc/ * Makefile.in (INTERNAL_FN_DEF, INTERNAL_FN_H): Define. (GIMPLE_H): Include $(INTERNAL_FN_H). (OBJS-common): Add internal-fn.o. (internal-fn.o): New rule. * internal-fn.def: New file. * internal-fn.h: Likewise. * internal-fn.c: Likewise. * gimple.h: Include internal-fn.h. (GF_CALL_INTERNAL): New gf_mask. (gimple_statement_call): Put fntype into a union with a new internal_fn field. (gimple_build_call_internal): Declare. (gimple_build_call_internal_vec): Likewise. (gimple_call_same_target_p): Likewise. (gimple_call_internal_p): New function. (gimple_call_internal_fn): Likewise. (gimple_call_fntype): Return null for internal calls. (gimple_call_set_fntype): Assert that the function is not internal. (gimple_call_set_fn): Likewise. (gimple_call_set_fndecl): Likewise. (gimple_call_set_internal_fn): New function. (gimple_call_addr_fndecl): Handle null functions. (gimple_call_return_type): Likewise null types. * gimple.c (gimple_build_call_internal_1): New function. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_call_same_target_p): Likewise. (gimple_call_flags): Handle calls to internal functions. (gimple_call_fnspec): New function. (gimple_call_arg_flags, gimple_call_return_flags): Use it. (gimple_has_side_effects): Handle null functions. (gimple_rhs_has_side_effects): Likewise. (gimple_call_copy_skip_args): Handle calls to internal functions. * cfgexpand.c (expand_call_stmt): Likewise. * expr.c (expand_expr_real_1): Assert that the call isn't internal. * gimple-fold.c (gimple_fold_call): Handle null functions. (gimple_fold_stmt_to_constant_1): Don't fold calls to internal functions. * gimple-low.c (gimple_check_call_args): Handle calls to internal functions. * gimple-pretty-print.c (dump_gimple_call): Likewise. * ipa-prop.c (ipa_analyze_call_uses): Handle null functions. * tree-cfg.c (verify_gimple_call): Handle calls to internal functions. (do_warn_unused_result): Likewise. * tree-eh.c (same_handler_p): Use gimple_call_same_target_p. * tree-ssa-ccp.c (ccp_fold_stmt): Handle calls to internal functions. * tree-ssa-dom.c (hashable_expr): Use the gimple statement to record the target of a call. (initialize_hash_element): Update accordingly. (hashable_expr_equal_p): Use gimple_call_same_target_p. (iterative_hash_hashable_expr): Handle calls to internal functions. (print_expr_hash_elt): Likewise. * tree-ssa-pre.c (can_value_number_call): Likewise. (eliminate): Handle null functions. * tree-ssa-sccvn.c (visit_use): Handle calls to internal functions. * tree-ssa-structalias.c (get_fi_for_callee): Likewise. (find_func_aliases): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_indirect_call_to_profile): Likewise. * lto-streamer-in.c (input_gimple_stmt): Likewise. * lto-streamer-out.c (output_gimple_stmt): Likewise. From-SVN: r172758
2011-04-20 10:21:25 +02:00
return;
if (cs->indirect_info->polymorphic && flag_devirtualize)
{
tree instance;
tree target = gimple_call_fn (call);
ipa_polymorphic_call_context context (current_function_decl,
target, call, &instance);
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
gcc_checking_assert (cs->indirect_info->otr_type
== obj_type_ref_class (target));
gcc_checking_assert (cs->indirect_info->otr_token
== tree_to_shwi (OBJ_TYPE_REF_TOKEN (target)));
cs->indirect_info->vptr_changed
= !context.get_dynamic_type (instance,
OBJ_TYPE_REF_OBJECT (target),
obj_type_ref_class (target), call);
cs->indirect_info->context = context;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (TREE_CODE (target) == SSA_NAME)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
ipa_analyze_indirect_call_uses (fbi, call, target);
else if (virtual_method_call_p (target))
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
ipa_analyze_virtual_call_uses (fbi, call, target);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
/* Analyze the call statement STMT with respect to formal parameters (described
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
in INFO) of caller given by FBI->NODE. Currently it only checks whether
formal parameters are called. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static void
ipa_analyze_stmt_uses (struct ipa_func_body_info *fbi, gimple *stmt)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
if (is_gimple_call (stmt))
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
ipa_analyze_call_uses (fbi, as_a <gcall *> (stmt));
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
}
/* Callback of walk_stmt_load_store_addr_ops for the visit_load.
If OP is a parameter declaration, mark it as used in the info structure
passed in DATA. */
static bool
visit_ref_for_mod_analysis (gimple *, tree op, tree, void *data)
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
{
struct ipa_node_params *info = (struct ipa_node_params *) data;
op = get_base_address (op);
if (op
&& TREE_CODE (op) == PARM_DECL)
{
int index = ipa_get_param_decl_index (info, op);
gcc_assert (index >= 0);
ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. 2011-07-18 Martin Jambor <mjambor@suse.cz> * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. (ipcp_values_pool): Declare. (ipcp_sources_pool): Likewise. (ipcp_lattice): Changed to forward declaration. (ipa_param_descriptor): Removed fields ipcp_lattice, types and cannot_devirtualize. (ipa_node_params): New fields descriptors, lattices, known_vals, clone_for_all_contexts and node dead, removed fields params and count_scale. (ipa_set_param_count): Removed. (ipa_get_param_count): Made to work with descriptors vector. (ipa_get_param): Updated. (ipa_param_cannot_devirtualize_p): Removed. (ipa_param_types_vec_empty): Likewise. (ipa_set_param_used): New function. (ipa_get_param_used): Updated to use descriptors vector. (ipa_func_list): Removed. (ipa_init_func_list): Removed declaration. (ipa_push_func_to_list_1): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_push_func_to_list): Removed. (ipa_lattice_from_jfunc): Remove declaration. (ipa_get_jf_pass_through_result): Declare. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_get_lattice): Update. (ipa_lat_is_single_const): New function. * ipa-prop.c (ipa_push_func_to_list_1): Removed. (ipa_init_func_list): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_get_param_decl_index): Fix coding style. (count_formal_params): Removed. (count_formal_params_1): Renamed to count_formal_params. (ipa_populate_param_decls): Update to use descriptors vector. (ipa_initialize_node_params): Likewise. (visit_ref_for_mod_analysis): Use ipa_set_param_used. (ipa_analyze_params_uses): Likewise. (ipa_free_node_params_substructures): Likewise and free also lattices and known values. (duplicate_array): Removed. (ipa_edge_duplication_hook): Add the new edge to the list of edge clones. (ipa_node_duplication_hook): Update to use new lattices. (ipa_free_all_structures_after_ipa_cp): Free alloc pools. (ipa_free_all_structures_after_iinln): Likewise. (ipa_write_node_info): Update to use new lattices. (ipa_read_node_info): Likewise. (ipa_get_jf_pass_through_result): New function. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc. * ipa-cp.c: Reimplemented. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed. (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter. (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise. * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies. * doc/invoke.texi (devirt-type-list-size): Removed description. (ipa-cp-value-list-size): Added description. * testsuite/gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-2.c: Likewise. * testsuite/gcc.dg/ipa/ipa-3.c: Likewise and made functions static. * testsuite/gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-5.c: Likewise. * testsuite/gcc.dg/ipa/ipa-7.c: Likewise. * testsuite/gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipacost-1.c: Likewise. * testsuite/gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some functions. * testsuite/gcc.dg/ipa/ipcp-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-2.c: Likewise. * testsuite/gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. From-SVN: r176424
2011-07-19 00:03:39 +02:00
ipa_set_param_used (info, index, true);
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
}
return false;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Scan the statements in BB and inspect the uses of formal parameters. Store
the findings in various structures of the associated ipa_node_params
structure, such as parameter flags, notes etc. FBI holds various data about
the function being analyzed. */
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
static void
ipa_analyze_params_uses_in_bb (struct ipa_func_body_info *fbi, basic_block bb)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple_stmt_iterator gsi;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple *stmt = gsi_stmt (gsi);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
if (is_gimple_debug (stmt))
continue;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
ipa_analyze_stmt_uses (fbi, stmt);
walk_stmt_load_store_addr_ops (stmt, fbi->info,
visit_ref_for_mod_analysis,
visit_ref_for_mod_analysis,
visit_ref_for_mod_analysis);
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
walk_stmt_load_store_addr_ops (gsi_stmt (gsi), fbi->info,
visit_ref_for_mod_analysis,
visit_ref_for_mod_analysis,
visit_ref_for_mod_analysis);
}
/* Calculate controlled uses of parameters of NODE. */
static void
ipa_analyze_controlled_uses (struct cgraph_node *node)
{
struct ipa_node_params *info = IPA_NODE_REF (node);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
for (int i = 0; i < ipa_get_param_count (info); i++)
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
{
tree parm = ipa_get_param (info, i);
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
int controlled_uses = 0;
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
/* For SSA regs see if parameter is used. For non-SSA we compute
the flag during modification analysis. */
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
if (is_gimple_reg (parm))
{
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
tree ddef = ssa_default_def (DECL_STRUCT_FUNCTION (node->decl),
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
parm);
if (ddef && !has_zero_uses (ddef))
{
imm_use_iterator imm_iter;
use_operand_p use_p;
ipa_set_param_used (info, i, true);
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, ddef)
if (!is_gimple_call (USE_STMT (use_p)))
{
if (!is_gimple_debug (USE_STMT (use_p)))
{
controlled_uses = IPA_UNDESCRIBED_USE;
break;
}
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
}
else
controlled_uses++;
}
else
controlled_uses = 0;
}
else
controlled_uses = IPA_UNDESCRIBED_USE;
ipa_set_controlled_uses (info, i, controlled_uses);
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
}
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Free stuff in BI. */
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
static void
free_ipa_bb_info (struct ipa_bb_info *bi)
{
bi->cg_edges.release ();
bi->param_aa_statuses.release ();
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Dominator walker driving the analysis. */
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
class analysis_dom_walker : public dom_walker
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
{
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
public:
analysis_dom_walker (struct ipa_func_body_info *fbi)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
: dom_walker (CDI_DOMINATORS), m_fbi (fbi) {}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
re PR tree-optimization/68619 (error: loop with header 6 not in loop tree) 2015-12-10 Jeff Law <law@redhat.com> PR tree-optimization/68619 * tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate return value from optimize_stmt. (dom_opt_dom_walker): Add new argument to dom_walker constructor. (pass_dominator:execute): If a block has an unreachable edge, remove all jump threads through any successor of the affected block. (record_equivalences_from_phis): Ignore alternative if the edge does not have EDGE_EXECUTABLE set. (single_incoming_edge_ignoring_loop_edges): Similarly. (optimize_stmt): If a gimple_code has a compile-time constant condition, return the edge taken for that constant value. Also change the condition to true/false as necessary. * domwalk.h (dom_walker::dom_walker): Add new argument skip_unreachable_blocks. Don't provide empty constructor body. (dom_walker::before_dom_children): Change return type. (dom_walker::bb_reachable): Declare new private method. (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::m_unreachable_dom): Declare new private data member. (dom_walker::m_skip_unreachable_blocks): Likewise. * domwalk.c: Include dumpfile.h. (dom_walker::dom_walker): New constructor. Initialize private data members. If needed, set EDGE_EXECUTABLE for all edges in the CFG, extracted from tree-ssa-sccvn.c. (dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::walk): Only call before_dom_children on reachable blocks. If before_dom_children returns an edge, then clear EDGE_EXECUTABLE for all other outgoing edges from the same block. For unreachable blocks, call propagate_unreachable_to_edges. Similarly, only call after_dom_children on reachable blocks. For unreachable blocks, conditionally clear m_unreachable_dom. * tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove private data member. (sccvn_dom_walker::after_dom_children): Use methods from dom_walker class. (run_scc_vn): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. Return the taken outgoing edge if a COND, SWITCH, or GOTO are optimized. * compare-elim.c (find_comparison_dom_walker::before_dom_children): Change return type to an edge. Always return NULL. * fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise. (rewrite_update_dom_walker::before_dom_children): Likewise. (mark_def_dom_children::before_dom_children): Likewise. * tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_dom_walker::before_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children): Likewise. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker::before_dom_children): Likewise. PR tree-optimization/68619 * gcc.dg/tree-ssa/pr68619-1.c: New test. * gcc.dg/tree-ssa/pr68619-2.c: New test. * gcc.dg/tree-ssa/pr68619-3.c: New test. * gcc.dg/tree-ssa/pr68619-4.c: New test. * gcc.dg/tree-ssa/pr68619-5.c: New test. From-SVN: r231527
2015-12-10 17:34:43 +01:00
virtual edge before_dom_children (basic_block);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
private:
struct ipa_func_body_info *m_fbi;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
};
re PR tree-optimization/68619 (error: loop with header 6 not in loop tree) 2015-12-10 Jeff Law <law@redhat.com> PR tree-optimization/68619 * tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate return value from optimize_stmt. (dom_opt_dom_walker): Add new argument to dom_walker constructor. (pass_dominator:execute): If a block has an unreachable edge, remove all jump threads through any successor of the affected block. (record_equivalences_from_phis): Ignore alternative if the edge does not have EDGE_EXECUTABLE set. (single_incoming_edge_ignoring_loop_edges): Similarly. (optimize_stmt): If a gimple_code has a compile-time constant condition, return the edge taken for that constant value. Also change the condition to true/false as necessary. * domwalk.h (dom_walker::dom_walker): Add new argument skip_unreachable_blocks. Don't provide empty constructor body. (dom_walker::before_dom_children): Change return type. (dom_walker::bb_reachable): Declare new private method. (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::m_unreachable_dom): Declare new private data member. (dom_walker::m_skip_unreachable_blocks): Likewise. * domwalk.c: Include dumpfile.h. (dom_walker::dom_walker): New constructor. Initialize private data members. If needed, set EDGE_EXECUTABLE for all edges in the CFG, extracted from tree-ssa-sccvn.c. (dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::walk): Only call before_dom_children on reachable blocks. If before_dom_children returns an edge, then clear EDGE_EXECUTABLE for all other outgoing edges from the same block. For unreachable blocks, call propagate_unreachable_to_edges. Similarly, only call after_dom_children on reachable blocks. For unreachable blocks, conditionally clear m_unreachable_dom. * tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove private data member. (sccvn_dom_walker::after_dom_children): Use methods from dom_walker class. (run_scc_vn): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. Return the taken outgoing edge if a COND, SWITCH, or GOTO are optimized. * compare-elim.c (find_comparison_dom_walker::before_dom_children): Change return type to an edge. Always return NULL. * fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise. (rewrite_update_dom_walker::before_dom_children): Likewise. (mark_def_dom_children::before_dom_children): Likewise. * tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_dom_walker::before_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children): Likewise. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker::before_dom_children): Likewise. PR tree-optimization/68619 * gcc.dg/tree-ssa/pr68619-1.c: New test. * gcc.dg/tree-ssa/pr68619-2.c: New test. * gcc.dg/tree-ssa/pr68619-3.c: New test. * gcc.dg/tree-ssa/pr68619-4.c: New test. * gcc.dg/tree-ssa/pr68619-5.c: New test. From-SVN: r231527
2015-12-10 17:34:43 +01:00
edge
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
analysis_dom_walker::before_dom_children (basic_block bb)
{
ipa_analyze_params_uses_in_bb (m_fbi, bb);
ipa_compute_jump_functions_for_bb (m_fbi, bb);
re PR tree-optimization/68619 (error: loop with header 6 not in loop tree) 2015-12-10 Jeff Law <law@redhat.com> PR tree-optimization/68619 * tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate return value from optimize_stmt. (dom_opt_dom_walker): Add new argument to dom_walker constructor. (pass_dominator:execute): If a block has an unreachable edge, remove all jump threads through any successor of the affected block. (record_equivalences_from_phis): Ignore alternative if the edge does not have EDGE_EXECUTABLE set. (single_incoming_edge_ignoring_loop_edges): Similarly. (optimize_stmt): If a gimple_code has a compile-time constant condition, return the edge taken for that constant value. Also change the condition to true/false as necessary. * domwalk.h (dom_walker::dom_walker): Add new argument skip_unreachable_blocks. Don't provide empty constructor body. (dom_walker::before_dom_children): Change return type. (dom_walker::bb_reachable): Declare new private method. (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::m_unreachable_dom): Declare new private data member. (dom_walker::m_skip_unreachable_blocks): Likewise. * domwalk.c: Include dumpfile.h. (dom_walker::dom_walker): New constructor. Initialize private data members. If needed, set EDGE_EXECUTABLE for all edges in the CFG, extracted from tree-ssa-sccvn.c. (dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::walk): Only call before_dom_children on reachable blocks. If before_dom_children returns an edge, then clear EDGE_EXECUTABLE for all other outgoing edges from the same block. For unreachable blocks, call propagate_unreachable_to_edges. Similarly, only call after_dom_children on reachable blocks. For unreachable blocks, conditionally clear m_unreachable_dom. * tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove private data member. (sccvn_dom_walker::after_dom_children): Use methods from dom_walker class. (run_scc_vn): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. Return the taken outgoing edge if a COND, SWITCH, or GOTO are optimized. * compare-elim.c (find_comparison_dom_walker::before_dom_children): Change return type to an edge. Always return NULL. * fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise. (rewrite_update_dom_walker::before_dom_children): Likewise. (mark_def_dom_children::before_dom_children): Likewise. * tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_dom_walker::before_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children): Likewise. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker::before_dom_children): Likewise. PR tree-optimization/68619 * gcc.dg/tree-ssa/pr68619-1.c: New test. * gcc.dg/tree-ssa/pr68619-2.c: New test. * gcc.dg/tree-ssa/pr68619-3.c: New test. * gcc.dg/tree-ssa/pr68619-4.c: New test. * gcc.dg/tree-ssa/pr68619-5.c: New test. From-SVN: r231527
2015-12-10 17:34:43 +01:00
return NULL;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
/* Release body info FBI. */
void
ipa_release_body_info (struct ipa_func_body_info *fbi)
{
int i;
struct ipa_bb_info *bi;
FOR_EACH_VEC_ELT (fbi->bb_infos, i, bi)
free_ipa_bb_info (bi);
fbi->bb_infos.release ();
}
/* Initialize the array describing properties of formal parameters
of NODE, analyze their uses and compute jump functions associated
with actual arguments of calls from within NODE. */
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
void
ipa_analyze_node (struct cgraph_node *node)
{
struct ipa_func_body_info fbi;
struct ipa_node_params *info;
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
info = IPA_NODE_REF (node);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
if (info->analysis_done)
return;
info->analysis_done = 1;
if (ipa_func_spec_opts_forbid_analysis_p (node))
{
for (int i = 0; i < ipa_get_param_count (info); i++)
{
ipa_set_param_used (info, i, true);
ipa_set_controlled_uses (info, i, IPA_UNDESCRIBED_USE);
}
return;
}
struct function *func = DECL_STRUCT_FUNCTION (node->decl);
push_cfun (func);
calculate_dominance_info (CDI_DOMINATORS);
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
ipa_initialize_node_params (node);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
ipa_analyze_controlled_uses (node);
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
fbi.node = node;
fbi.info = IPA_NODE_REF (node);
fbi.bb_infos = vNULL;
fbi.bb_infos.safe_grow_cleared (last_basic_block_for_fn (cfun));
fbi.param_count = ipa_get_param_count (info);
fbi.aa_walked = 0;
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
for (struct cgraph_edge *cs = node->callees; cs; cs = cs->next_callee)
{
ipa_bb_info *bi = ipa_get_bb_info (&fbi, gimple_bb (cs->call_stmt));
bi->cg_edges.safe_push (cs);
}
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
for (struct cgraph_edge *cs = node->indirect_calls; cs; cs = cs->next_callee)
{
ipa_bb_info *bi = ipa_get_bb_info (&fbi, gimple_bb (cs->call_stmt));
bi->cg_edges.safe_push (cs);
}
analysis_dom_walker (&fbi).walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
ipa_release_body_info (&fbi);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
free_dominance_info (CDI_DOMINATORS);
pop_cfun ();
ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. 2010-06-25 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_param_descriptor): Removed the modified flag. (struct ipa_node_params): Removed the modification_analysis_done flag. (ipa_is_param_modified): Removed. (ipa_analyze_node): Declare. (ipa_compute_jump_functions): Remove declaration. (ipa_count_arguments): Likewise. (ipa_detect_param_modifications): Likewise. (ipa_analyze_params_uses): Likewise. * ipa-prop.c (struct param_analysis_info): New type. (visit_store_addr_for_mod_analysis): Removed. (visit_load_for_mod_analysis): Renamed to visit_ref_for_mod_analysis, moved down in the file. (ipa_detect_param_modifications): Merged into ipa_analyze_params_uses. (ipa_count_arguments): Made static. (mark_modified): New function. (is_parm_modified_before_call): New function. (compute_pass_through_member_ptrs): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_compute_jump_functions_for_edge): New parameter parms_info, pass it to compute_pass_through_member_ptrs. (ipa_compute_jump_functions): New parameter parms_info, pass it to ipa_compute_jump_functions_for_edge. Call ipa_initialize_node_params on the callee if it is analyzed. Made static. (ipa_analyze_indirect_call_uses): New parameter parms_info, call is_parm_modified_before_call instead of ipa_is_param_modified. (ipa_analyze_call_uses): New parameter parms_info, pass it to ipa_analyze_indirect_call_uses. (ipa_analyze_stmt_uses): New parameter parms_info, pass it to ipa_analyze_call_uses. (ipa_analyze_params_uses): New parameter parms_info, pass it to ipa_analyze_stmt_uses. Also perform the used analysis. Made static. (ipa_analyze_node): New function. (ipa_print_node_params): Do not dump the modified flag. (ipa_write_node_info): Assert uses_analysis_done rather than streaming it. Do not stream the modified parameter flag. (ipa_read_node_info): Set uses_analysis_done to 1 instead of streaming it. Do not stream the modified parameter flag. * ipa-cp.c (ipcp_analyze_node): Removed. (ipcp_init_stage): Iterate only once over the nodes, analyze each one with only a call to ipa_analyze_node. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Analyze the node with only a call to ipa_analyze_node. * testsuite/g++.dg/ipa/iinline-3.C: New test. * testsuite/gcc.dg/ipa/modif-1.c: Removed. From-SVN: r161384
2010-06-25 16:27:47 +02:00
}
/* Update the jump functions associated with call graph edge E when the call
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
graph edge CS is being inlined, assuming that E->caller is already (possibly
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
indirectly) inlined into CS->callee and that E has not been inlined. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
static void
update_jump_functions_after_inlining (struct cgraph_edge *cs,
struct cgraph_edge *e)
{
struct ipa_edge_args *top = IPA_EDGE_REF (cs);
struct ipa_edge_args *args = IPA_EDGE_REF (e);
int count = ipa_get_cs_argument_count (args);
int i;
for (i = 0; i < count; i++)
{
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct ipa_jump_func *dst = ipa_get_ith_jump_func (args, i);
struct ipa_polymorphic_call_context *dst_ctx
= ipa_get_ith_polymorhic_call_context (args, i);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (dst->type == IPA_JF_ANCESTOR)
{
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct ipa_jump_func *src;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
int dst_fid = dst->value.ancestor.formal_id;
struct ipa_polymorphic_call_context *src_ctx
= ipa_get_ith_polymorhic_call_context (top, dst_fid);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
/* Variable number of arguments can cause havoc if we try to access
one that does not exist in the inlined edge. So make sure we
don't. */
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (dst_fid >= ipa_get_cs_argument_count (top))
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipa_set_jf_unknown (dst);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
continue;
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
src = ipa_get_ith_jump_func (top, dst_fid);
if (src_ctx && !src_ctx->useless_p ())
{
struct ipa_polymorphic_call_context ctx = *src_ctx;
/* TODO: Make type preserved safe WRT contexts. */
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
if (!ipa_get_jf_ancestor_type_preserved (dst))
ctx.possible_dynamic_type_change (e->in_polymorphic_cdtor);
ctx.offset_by (dst->value.ancestor.offset);
if (!ctx.useless_p ())
{
if (!dst_ctx)
{
vec_safe_grow_cleared (args->polymorphic_call_contexts,
count);
dst_ctx = ipa_get_ith_polymorhic_call_context (args, i);
}
dst_ctx->combine_with (ctx);
}
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (src->agg.items
&& (dst->value.ancestor.agg_preserved || !src->agg.by_ref))
{
struct ipa_agg_jf_item *item;
int j;
/* Currently we do not produce clobber aggregate jump functions,
replace with merging when we do. */
gcc_assert (!dst->agg.items);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dst->agg.items = vec_safe_copy (src->agg.items);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
dst->agg.by_ref = src->agg.by_ref;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_SAFE_ELT (dst->agg.items, j, item)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
item->offset -= dst->value.ancestor.offset;
}
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
if (src->type == IPA_JF_PASS_THROUGH
&& src->value.pass_through.operation == NOP_EXPR)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
dst->value.ancestor.formal_id = src->value.pass_through.formal_id;
dst->value.ancestor.agg_preserved &=
src->value.pass_through.agg_preserved;
}
else if (src->type == IPA_JF_PASS_THROUGH
&& TREE_CODE_CLASS (src->value.pass_through.operation) == tcc_unary)
{
dst->value.ancestor.formal_id = src->value.pass_through.formal_id;
dst->value.ancestor.agg_preserved = false;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
else if (src->type == IPA_JF_ANCESTOR)
{
dst->value.ancestor.formal_id = src->value.ancestor.formal_id;
dst->value.ancestor.offset += src->value.ancestor.offset;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
dst->value.ancestor.agg_preserved &=
src->value.ancestor.agg_preserved;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
else
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipa_set_jf_unknown (dst);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
else if (dst->type == IPA_JF_PASS_THROUGH)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct ipa_jump_func *src;
/* We must check range due to calls with variable number of arguments
and we cannot combine jump functions with operations. */
if (dst->value.pass_through.operation == NOP_EXPR
&& (dst->value.pass_through.formal_id
< ipa_get_cs_argument_count (top)))
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
int dst_fid = dst->value.pass_through.formal_id;
src = ipa_get_ith_jump_func (top, dst_fid);
bool dst_agg_p = ipa_get_jf_pass_through_agg_preserved (dst);
struct ipa_polymorphic_call_context *src_ctx
= ipa_get_ith_polymorhic_call_context (top, dst_fid);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (src_ctx && !src_ctx->useless_p ())
{
struct ipa_polymorphic_call_context ctx = *src_ctx;
/* TODO: Make type preserved safe WRT contexts. */
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
if (!ipa_get_jf_pass_through_type_preserved (dst))
ctx.possible_dynamic_type_change (e->in_polymorphic_cdtor);
if (!ctx.useless_p ())
{
if (!dst_ctx)
{
vec_safe_grow_cleared (args->polymorphic_call_contexts,
count);
dst_ctx = ipa_get_ith_polymorhic_call_context (args, i);
}
dst_ctx->combine_with (ctx);
}
}
switch (src->type)
{
case IPA_JF_UNKNOWN:
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipa_set_jf_unknown (dst);
break;
case IPA_JF_CONST:
ipa_set_jf_cst_copy (dst, src);
break;
case IPA_JF_PASS_THROUGH:
{
int formal_id = ipa_get_jf_pass_through_formal_id (src);
enum tree_code operation;
operation = ipa_get_jf_pass_through_operation (src);
if (operation == NOP_EXPR)
{
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
bool agg_p;
agg_p = dst_agg_p
&& ipa_get_jf_pass_through_agg_preserved (src);
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_jf_simple_pass_through (dst, formal_id, agg_p);
}
else if (TREE_CODE_CLASS (operation) == tcc_unary)
ipa_set_jf_unary_pass_through (dst, formal_id, operation);
else
{
tree operand = ipa_get_jf_pass_through_operand (src);
ipa_set_jf_arith_pass_through (dst, formal_id, operand,
operation);
}
break;
}
case IPA_JF_ANCESTOR:
{
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
bool agg_p;
agg_p = dst_agg_p
&& ipa_get_jf_ancestor_agg_preserved (src);
ipa_set_ancestor_jf (dst,
ipa_get_jf_ancestor_offset (src),
ipa_get_jf_ancestor_formal_id (src),
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
agg_p);
break;
}
default:
gcc_unreachable ();
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (src->agg.items
&& (dst_agg_p || !src->agg.by_ref))
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
/* Currently we do not produce clobber aggregate jump
functions, replace with merging when we do. */
gcc_assert (!dst->agg.items);
dst->agg.by_ref = src->agg.by_ref;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
dst->agg.items = vec_safe_copy (src->agg.items);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
else
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipa_set_jf_unknown (dst);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
}
/* If TARGET is an addr_expr of a function declaration, make it the
(SPECULATIVE)destination of an indirect edge IE and return the edge.
Otherwise, return NULL. */
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
ipa-prop.h (enum ipa_lattice_type): Changed comments. 2010-08-05 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (enum ipa_lattice_type): Changed comments. (struct ipa_param_descriptor): New fields types and cannot_devirtualize. (ipa_param_cannot_devirtualize_p): New function. (ipa_param_types_vec_empty): Likewise. (ipa_make_edge_direct_to_target): Declare. * ipa-cp.c: Fixed first stage driver name in initial comment, described devirtualization there too. (ipcp_analyze_node): Call ipa_analyze_params_uses. (ipcp_print_all_lattices): Print devirtualization info. (ipa_set_param_cannot_devirtualize): New function. (ipcp_initialize_node_lattices): Set cannot_devirtualize when setting lattice to BOTTOM. (ipcp_init_stage): Merged into... (ipcp_generate_summary): ...its caller. (ipcp_change_tops_to_bottom): Also process type lists. (ipcp_add_param_type): New function. (ipcp_copy_types): Likewise. (ipcp_propagate_types): Likewise. (ipcp_propagate_stage): Also propagate types. (ipcp_need_redirect_p): Variable jump_func moved to its scope block. Also return true if propagated types require it. (ipcp_update_callgraph): Dump redirection info. (ipcp_process_devirtualization_opportunities): New function. (ipcp_const_param_count): Include known type information. (ipcp_insert_stage): Call ipcp_process_devirtualization_opportunities on new node. Fixed formatting. * ipa-prop.c (make_edge_direct_to_target): Renamed to ipa_make_edge_direct_to_target and changed all callers. Made externally visible. (ipa_node_duplication_hook): Duplicate types vector. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Also try to redirect outgoing calls for which we can't get a decl from the statement. Check that we can get a decl from the call statement. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses only when ipa-cp is disabled. * tree-inline.c (get_indirect_callee_fndecl): Removed. (expand_call_inline): Do not call get_indirect_callee_fndecl. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): New parameter. * Makefile.in (ipa-cp.o): Add gimple.h to dependencies. * testsuite/g++.dg/ipa/devirt-1.C: New test. * testsuite/g++.dg/ipa/devirt-2.C: Likewise. * testsuite/g++.dg/ipa/devirt-3.C: Likewise. * testsuite/g++.dg/ipa/devirt-4.C: Likewise. * testsuite/g++.dg/ipa/devirt-5.C: Likewise. * testsuite/gcc.dg/ipa/iinline-3.c: Likewise. From-SVN: r162911
2010-08-05 15:23:07 +02:00
struct cgraph_edge *
ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target,
bool speculative)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
struct cgraph_node *callee;
struct inline_edge_summary *es = inline_edge_summary (ie);
bool unreachable = false;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
re PR tree-optimization/46053 (g++.dg/torture/pr45699.C FAILs with -fno-early-inlining) 2010-12-15 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46053 PR middle-end/46287 PR middle-end/46242 * cgraph.h (cgraph_indirect_call_info): New field thunk_delta. * gimple.h (gimple_fold_obj_type_ref): Declaration removed. (gimple_fold_call): Declare. (gimple_adjust_this_by_delta): Likewise. * cgraph.c (cgraph_make_edge_direct): New parameter delta. Updated all users. (cgraph_clone_edge): Create a copy of indirect_info also for direct edges. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Adjust this parameters. * gimple-fold.c (gimple_fold_obj_type_ref_known_binfo): Renamed to gimple_get_virt_mehtod_for_binfo, new parameter delta. Do not search through thunks, in fact bail out if we encounter one, check that BINFO_VIRTUALS is not NULL. (gimple_adjust_this_by_delta): New function. (gimple_fold_obj_type_ref): Removed. (gimple_fold_obj_type_ref_call): New function. (fold_gimple_call): Renamed to gimple_fold_call, made external. Updated users. Call gimple_fold_obj_type_ref_call instead of gimple_fold_obj_type_ref. * ipa-cp.c (ipcp_process_devirtualization_opportunities): Process thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): New parameter delta. Updated callers. (ipa_write_indirect_edge_info): Stream thunk_delta. (ipa_read_indirect_edge_info): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Use gimple_fold_call instead of gimple_fold_obj_type_ref. * testsuite/g++.dg/ipa/pr46053.C: New test. * testsuite/g++.dg/ipa/pr46287-1.C: Likewise. * testsuite/g++.dg/ipa/pr46287-2.C: Likewise. * testsuite/g++.dg/ipa/pr46287-3.C: Likewise. * testsuite/g++.dg/torture/covariant-1.C: Likewise. * testsuite/g++.dg/torture/pr46287.C: Likewise. From-SVN: r167855
2010-12-15 14:19:46 +01:00
if (TREE_CODE (target) == ADDR_EXPR)
target = TREE_OPERAND (target, 0);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (TREE_CODE (target) != FUNCTION_DECL)
{
target = canonicalize_constructor_val (target, NULL);
if (!target || TREE_CODE (target) != FUNCTION_DECL)
{
/* Member pointer call that goes through a VMT lookup. */
if (ie->indirect_info->member_ptr
/* Or if target is not an invariant expression and we do not
know if it will evaulate to function at runtime.
This can happen when folding through &VAR, where &VAR
is IP invariant, but VAR itself is not.
TODO: Revisit this when GCC 5 is branched. It seems that
member_ptr check is not needed and that we may try to fold
the expression and see if VAR is readonly. */
|| !is_gimple_ip_invariant (target))
{
if (dump_enabled_p ())
{
location_t loc = gimple_location_safe (ie->call_stmt);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
"discovered direct call non-invariant "
"%s/%i\n",
ie->caller->name (), ie->caller->order);
}
return NULL;
}
if (dump_enabled_p ())
{
location_t loc = gimple_location_safe (ie->call_stmt);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
"discovered direct call to non-function in %s/%i, "
"making it __builtin_unreachable\n",
ie->caller->name (), ie->caller->order);
}
target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
callee = cgraph_node::get_create (target);
unreachable = true;
}
else
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
callee = cgraph_node::get (target);
}
else
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
callee = cgraph_node::get (target);
/* Because may-edges are not explicitely represented and vtable may be external,
we may create the first reference to the object in the unit. */
if (!callee || callee->global.inlined_to)
{
/* We are better to ensure we can refer to it.
In the case of static functions we are out of luck, since we already
removed its body. In the case of public functions we may or may
not introduce the reference. */
if (!canonicalize_constructor_val (target, NULL)
|| !TREE_PUBLIC (target))
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered call to a known target "
"(%s/%i -> %s/%i) but can not refer to it. Giving up.\n",
xstrdup_for_dump (ie->caller->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
ie->caller->order,
xstrdup_for_dump (ie->callee->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
ie->callee->order);
return NULL;
}
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
callee = cgraph_node::get_create (target);
}
/* If the edge is already speculated. */
if (speculative && ie->speculative)
{
struct cgraph_edge *e2;
struct ipa_ref *ref;
ie->speculative_call_info (e2, ie, ref);
if (e2->callee->ultimate_alias_target ()
!= callee->ultimate_alias_target ())
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered call to a speculative target "
"(%s/%i -> %s/%i) but the call is already speculated to %s/%i. Giving up.\n",
xstrdup_for_dump (ie->caller->name ()),
ie->caller->order,
xstrdup_for_dump (callee->name ()),
callee->order,
xstrdup_for_dump (e2->callee->name ()),
e2->callee->order);
}
else
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered call to a speculative target "
"(%s/%i -> %s/%i) this agree with previous speculation.\n",
xstrdup_for_dump (ie->caller->name ()),
ie->caller->order,
xstrdup_for_dump (callee->name ()),
callee->order);
}
return NULL;
}
if (!dbg_cnt (devirt))
return NULL;
ipa_check_create_node_params ();
re PR tree-optimization/46053 (g++.dg/torture/pr45699.C FAILs with -fno-early-inlining) 2010-12-15 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46053 PR middle-end/46287 PR middle-end/46242 * cgraph.h (cgraph_indirect_call_info): New field thunk_delta. * gimple.h (gimple_fold_obj_type_ref): Declaration removed. (gimple_fold_call): Declare. (gimple_adjust_this_by_delta): Likewise. * cgraph.c (cgraph_make_edge_direct): New parameter delta. Updated all users. (cgraph_clone_edge): Create a copy of indirect_info also for direct edges. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Adjust this parameters. * gimple-fold.c (gimple_fold_obj_type_ref_known_binfo): Renamed to gimple_get_virt_mehtod_for_binfo, new parameter delta. Do not search through thunks, in fact bail out if we encounter one, check that BINFO_VIRTUALS is not NULL. (gimple_adjust_this_by_delta): New function. (gimple_fold_obj_type_ref): Removed. (gimple_fold_obj_type_ref_call): New function. (fold_gimple_call): Renamed to gimple_fold_call, made external. Updated users. Call gimple_fold_obj_type_ref_call instead of gimple_fold_obj_type_ref. * ipa-cp.c (ipcp_process_devirtualization_opportunities): Process thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): New parameter delta. Updated callers. (ipa_write_indirect_edge_info): Stream thunk_delta. (ipa_read_indirect_edge_info): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Use gimple_fold_call instead of gimple_fold_obj_type_ref. * testsuite/g++.dg/ipa/pr46053.C: New test. * testsuite/g++.dg/ipa/pr46287-1.C: Likewise. * testsuite/g++.dg/ipa/pr46287-2.C: Likewise. * testsuite/g++.dg/ipa/pr46287-3.C: Likewise. * testsuite/g++.dg/torture/covariant-1.C: Likewise. * testsuite/g++.dg/torture/pr46287.C: Likewise. From-SVN: r167855
2010-12-15 14:19:46 +01:00
cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta. 2011-09-02 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta. * gimple-fold.c (gimple_get_virt_method_for_binfo): Rewritten to use BINFO_VTABLE. Parameter delta removed, all callers updated. * tree.c (free_lang_data_in_binfo): Clear BINFO_VIRTUALs instead BINFO_VTABLE. * cgraph.c (cgraph_make_edge_direct): Removed parameter delta, updated all calls. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Removed handling of thunk_delta. * ipa-cp.c (get_indirect_edge_target): Removed parameter delta. (devirtualization_time_bonus): Do not handle thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Likewise. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise. Mark parameter set as unused. (output_edge_opt_summary): Likewise. Mark both parameters as unused. * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise. Mark parameter set as unused. (output_edge_opt_summary): Likewise. Mark both parameters as unused. (input_edge_opt_summary): Likewise. * lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not stream BINFO_VIRTUALS at all. * lto-streamer-in.c (lto_input_ts_binfo_tree_pointers): Likewise. * testsuite/g++.dg/ipa/devirt-3.C: Added a distraction method. * testsuite/g++.dg/ipa/ivinline-7.C: Added a test for direct call discovery, xfailed test for inlining. * testsuite/g++.dg/ipa/ivinline-9.C: Likewise. From-SVN: r178472
2011-09-02 15:26:30 +02:00
/* We can not make edges to inline clones. It is bug that someone removed
the cgraph node too early. */
gcc_assert (!callee->global.inlined_to);
if (dump_file && !unreachable)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
fprintf (dump_file, "ipa-prop: Discovered %s call to a %s target "
re PR tree-optimization/46053 (g++.dg/torture/pr45699.C FAILs with -fno-early-inlining) 2010-12-15 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46053 PR middle-end/46287 PR middle-end/46242 * cgraph.h (cgraph_indirect_call_info): New field thunk_delta. * gimple.h (gimple_fold_obj_type_ref): Declaration removed. (gimple_fold_call): Declare. (gimple_adjust_this_by_delta): Likewise. * cgraph.c (cgraph_make_edge_direct): New parameter delta. Updated all users. (cgraph_clone_edge): Create a copy of indirect_info also for direct edges. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Adjust this parameters. * gimple-fold.c (gimple_fold_obj_type_ref_known_binfo): Renamed to gimple_get_virt_mehtod_for_binfo, new parameter delta. Do not search through thunks, in fact bail out if we encounter one, check that BINFO_VIRTUALS is not NULL. (gimple_adjust_this_by_delta): New function. (gimple_fold_obj_type_ref): Removed. (gimple_fold_obj_type_ref_call): New function. (fold_gimple_call): Renamed to gimple_fold_call, made external. Updated users. Call gimple_fold_obj_type_ref_call instead of gimple_fold_obj_type_ref. * ipa-cp.c (ipcp_process_devirtualization_opportunities): Process thunk deltas. (ipcp_discover_new_direct_edges): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): New parameter delta. Updated callers. (ipa_write_indirect_edge_info): Stream thunk_delta. (ipa_read_indirect_edge_info): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Use gimple_fold_call instead of gimple_fold_obj_type_ref. * testsuite/g++.dg/ipa/pr46053.C: New test. * testsuite/g++.dg/ipa/pr46287-1.C: Likewise. * testsuite/g++.dg/ipa/pr46287-2.C: Likewise. * testsuite/g++.dg/ipa/pr46287-3.C: Likewise. * testsuite/g++.dg/torture/covariant-1.C: Likewise. * testsuite/g++.dg/torture/pr46287.C: Likewise. From-SVN: r167855
2010-12-15 14:19:46 +01:00
"(%s/%i -> %s/%i), for stmt ",
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
ie->indirect_info->polymorphic ? "a virtual" : "an indirect",
speculative ? "speculative" : "known",
xstrdup_for_dump (ie->caller->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
ie->caller->order,
xstrdup_for_dump (callee->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
callee->order);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (ie->call_stmt)
print_gimple_stmt (dump_file, ie->call_stmt, 2, TDF_SLIM);
else
fprintf (dump_file, "with uid %i\n", ie->lto_stmt_uid);
cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraph.c (cgraph_update_edge_in_call_site_hash): New function. (cgraph_add_edge_to_call_site_hash): Deal with speculative calls. (cgraph_set_call_stmt): Likewise. (cgraph_create_edge_1): Fix release checking compilatoin; clear lto_stmt_uid. (cgraph_free_edge): Free indirect info. (cgraph_turn_edge_to_speculative): New function. (cgraph_speculative_call_info): New function. (cgraph_make_edge_direct): Return direct edge; handle speculation. (cgraph_redirect_edge_call_stmt_to_callee): Expand speculative edges. (dump_cgraph_node): Dump speculation. (verify_edge_count_and_frequency): Accept speculative edges. (verify_edge_corresponds_to_fndecl): Handle partitioned cgraph. (verify_cgraph_node): Handle speculation. * cgraph.h (cgraph_edge): Add SPECULATIVE flag. (cgraph_set_call_stmt): Update prototype. (cgraph_make_edge_direct): Update prototype. (cgraph_speculative_call_info): Declare. * ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge to change; update call of ipa_find_references. * ipa-ref.c (ipa_record_reference): Fix return value; clear lto_stmt_uid and speculative flags. (ipa_dump_references): Dump speculation. (ipa_clone_references): Clone speculative flag. (ipa_clone_referring): Likewise. (ipa_clone_ref): New function. (ipa_find_reference): Look into lto_stmt_uids (ipa_clear_stmts_in_references): Do not clear speculative calls. * ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags. (ipa_find_reference): Update declaration. (ipa_clone_ref): Declare. * lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0; stream speculative flag. (lto_output_ref): Stream statements uids and speculation. (input_ref): Likewise. (input_edge): Stream speuclation. * cgraphclones.c (cgraph_clone_edge): Clone speculation. (cgraph_set_call_stmt_including_clones): Handle speculation. * ipa-inline.c (heap_edge_removal_hook): New function. (inline_small_functions): Register it. * lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking; also initialize refs. * ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for edge to change. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_simple_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Look proper lto_stmt_uid. (propagate_controlled_uses): Likewise. (propagate_controlled_uses): Liekwise. * tree-inline.c (copy_bb): Copy speculative edges. (redirect_all_calls): New function. (copy_cfg_body): Do redirection after loop info is updated. (delete_unreachable_blocks_update_callgraph): Updadte speculation. From-SVN: r201632
2013-08-09 17:23:19 +02:00
}
if (dump_enabled_p ())
{
location_t loc = gimple_location_safe (ie->call_stmt);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
"converting indirect call in %s to direct call to %s\n",
ie->caller->name (), callee->name ());
}
if (!speculative)
{
struct cgraph_edge *orig = ie;
ie = ie->make_direct (callee);
/* If we resolved speculative edge the cost is already up to date
for direct call (adjusted by inline_edge_duplication_hook). */
if (ie == orig)
{
es = inline_edge_summary (ie);
es->call_stmt_size -= (eni_size_weights.indirect_call_cost
- eni_size_weights.call_cost);
es->call_stmt_time -= (eni_time_weights.indirect_call_cost
- eni_time_weights.call_cost);
}
}
else
{
if (!callee->can_be_discarded_p ())
{
cgraph_node *alias;
alias = dyn_cast<cgraph_node *> (callee->noninterposable_alias ());
if (alias)
callee = alias;
}
/* make_speculative will update ie's cost to direct call cost. */
ie = ie->make_speculative
(callee, ie->count * 8 / 10, ie->frequency * 8 / 10);
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
return ie;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
/* Attempt to locate an interprocedural constant at a given REQ_OFFSET in
CONSTRUCTOR and return it. Return NULL if the search fails for some
reason. */
static tree
find_constructor_constant_at_offset (tree constructor, HOST_WIDE_INT req_offset)
{
tree type = TREE_TYPE (constructor);
if (TREE_CODE (type) != ARRAY_TYPE
&& TREE_CODE (type) != RECORD_TYPE)
return NULL;
unsigned ix;
tree index, val;
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (constructor), ix, index, val)
{
HOST_WIDE_INT elt_offset;
if (TREE_CODE (type) == ARRAY_TYPE)
{
offset_int off;
tree unit_size = TYPE_SIZE_UNIT (TREE_TYPE (type));
gcc_assert (TREE_CODE (unit_size) == INTEGER_CST);
if (index)
{
if (TREE_CODE (index) == RANGE_EXPR)
off = wi::to_offset (TREE_OPERAND (index, 0));
else
off = wi::to_offset (index);
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
if (TYPE_DOMAIN (type) && TYPE_MIN_VALUE (TYPE_DOMAIN (type)))
{
tree low_bound = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
gcc_assert (TREE_CODE (unit_size) == INTEGER_CST);
off = wi::sext (off - wi::to_offset (low_bound),
TYPE_PRECISION (TREE_TYPE (index)));
}
off *= wi::to_offset (unit_size);
/* ??? Handle more than just the first index of a
RANGE_EXPR. */
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
}
else
off = wi::to_offset (unit_size) * ix;
off = wi::lshift (off, LOG2_BITS_PER_UNIT);
if (!wi::fits_shwi_p (off) || wi::neg_p (off))
continue;
elt_offset = off.to_shwi ();
}
else if (TREE_CODE (type) == RECORD_TYPE)
{
gcc_checking_assert (index && TREE_CODE (index) == FIELD_DECL);
if (DECL_BIT_FIELD (index))
continue;
elt_offset = int_bit_position (index);
}
else
gcc_unreachable ();
if (elt_offset > req_offset)
return NULL;
if (TREE_CODE (val) == CONSTRUCTOR)
return find_constructor_constant_at_offset (val,
req_offset - elt_offset);
if (elt_offset == req_offset
&& is_gimple_reg_type (TREE_TYPE (val))
&& is_gimple_ip_invariant (val))
return val;
}
return NULL;
}
/* Check whether SCALAR could be used to look up an aggregate interprocedural
invariant from a static constructor and if so, return it. Otherwise return
NULL. */
static tree
ipa_find_agg_cst_from_init (tree scalar, HOST_WIDE_INT offset, bool by_ref)
{
if (by_ref)
{
if (TREE_CODE (scalar) != ADDR_EXPR)
return NULL;
scalar = TREE_OPERAND (scalar, 0);
}
tree-ssa.c (target_for_debug_bind, [...]): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P macros. * tree-ssa.c (target_for_debug_bind, verify_phi_args, ssa_undefined_value_p, maybe_optimize_var): Use VAR_P and/or VAR_OR_FUNCTION_DECL_P macros. * tree-chkp.c (chkp_register_var_initializer, chkp_make_static_bounds, chkp_get_bounds_for_decl_addr, chkp_parse_array_and_component_ref, chkp_find_bounds_1): Likewise. * ipa-polymorphic-call.c (decl_maybe_in_construction_p): Likewise. * hsa-gen.c (get_symbol_for_decl): Likewise. * cgraphunit.c (check_global_declaration, analyze_functions, handle_alias_pairs, thunk_adjust, cgraph_node::expand_thunk): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p, canonicalize_constructor_val, gimple_get_virt_method_for_vtable): Likewise. * tree.c (set_decl_section_name, copy_node_stat, need_assembler_name_p, free_lang_data_in_decl, find_decls_types_r, merge_dllimport_decl_attributes, handle_dll_attribute, decl_init_priority_insert, auto_var_in_fn_p, array_at_struct_end_p, verify_type): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior, find_explicit_erroneous_behavior): Likewise. * sdbout.c (sdbout_toplevel_data, sdbout_late_global_decl): Likewise. * ipa.c (process_references): Likewise. * tree-chkp-opt.c (chkp_get_check_result): Likewise. * varasm.c (get_block_for_decl, use_blocks_for_decl_p, make_decl_rtl, notice_global_symbol, assemble_variable, mark_decl_referenced, build_constant_desc, output_constant_def_contents, do_assemble_alias, make_decl_one_only, default_section_type_flags, categorize_decl_for_section, default_encode_section_info): Likewise. * trans-mem.c (requires_barrier): Likewise. * gimple-expr.c (mark_addressable): Likewise. * cfgexpand.c (add_scope_conflicts_1, expand_one_var, expand_used_vars_for_block, clear_tree_used, stack_protect_decl_p, expand_debug_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * ubsan.c (instrument_bool_enum_load): Likewise. * tree-pretty-print.c (print_declaration): Likewise. * simplify-rtx.c (delegitimize_mem_from_attrs): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars): Likewise. * asan.c (asan_protect_global, instrument_derefs): Likewise. * tree-into-ssa.c (rewrite_stmt, maybe_register_def, pass_build_ssa::execute): Likewise. * var-tracking.c (var_debug_decl, track_expr_p): Likewise. * tree-ssa-loop-ivopts.c (force_expr_to_var_cost, split_address_cost): Likewise. * ipa-split.c (test_nonssa_use, consider_split, mark_nonssa_use): Likewise. * tree-inline.c (insert_debug_decl_map, remap_ssa_name, can_be_nonlocal, remap_decls, copy_debug_stmt, initialize_inlined_parameters, add_local_variables, reset_debug_binding, replace_locals_op): Likewise. * dse.c (can_escape): Likewise. * ipa-devirt.c (compare_virtual_tables, referenced_from_vtable_p): Likewise. * tree-diagnostic.c (default_tree_printer): Likewise. * tree-streamer-in.c (unpack_ts_decl_common_value_fields, unpack_ts_decl_with_vis_value_fields, lto_input_ts_decl_common_tree_pointers): Likewise. * builtins.c (builtin_save_expr, fold_builtin_expect, readonly_data_expr): Likewise. * tree-ssa-structalias.c (new_var_info, get_constraint_for_ssa_var, create_variable_info_for, set_uids_in_ptset, visit_loadstore): Likewise. * gimple-streamer-out.c (output_gimple_stmt): Likewise. * gimplify.c (force_constant_size, gimplify_bind_expr, gimplify_decl_expr, gimplify_var_or_parm_decl, gimplify_compound_lval, gimplify_init_constructor, gimplify_modify_expr, gimplify_asm_expr, gimplify_oacc_declare, gimplify_type_sizes): Likewise. * cgraphbuild.c (record_reference, record_type_list, mark_address, mark_load, mark_store, pass_build_cgraph_edges::execute): Likewise. * tree-ssa-live.c (mark_all_vars_used_1, remove_unused_scope_block_p, remove_unused_locals): Likewise. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p, ptrs_compare_unequal, ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Likewise. * function.c (instantiate_expr, instantiate_decls_1, setjmp_vars_warning, add_local_decl): Likewise. * alias.c (ao_ref_from_mem, get_alias_set, compare_base_symbol_refs): Likewise. * tree-stdarg.c (find_va_list_reference, va_list_counter_struct_op, va_list_ptr_read, va_list_ptr_write, check_all_va_list_escapes, optimize_va_list_gpr_fpr_size): Likewise. * tree-nrv.c (pass_nrv::execute): Likewise. * tsan.c (instrument_expr): Likewise. * tree-ssa-dce.c (remove_dead_stmt): Likewise. * vtable-verify.c (verify_bb_vtables): Likewise. * tree-dfa.c (ssa_default_def, set_ssa_default_def, get_ref_base_and_extent): Likewise. * toplev.c (wrapup_global_declaration_1, wrapup_global_declaration_2): Likewise. * tree-sra.c (static bool constant_decl_p, find_var_candidates, analyze_all_variable_accesses): Likewise. * tree-nested.c (get_nonlocal_debug_decl, convert_nonlocal_omp_clauses, note_nonlocal_vla_type, note_nonlocal_block_vlas, convert_nonlocal_reference_stmt, get_local_debug_decl, convert_local_omp_clauses, convert_local_reference_stmt, nesting_copy_decl, remap_vla_decls): Likewise. * tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Likewise. * stmt.c (decl_overlaps_hard_reg_set_p): Likewise. * dbxout.c (dbxout_late_global_decl, dbxout_type_fields, dbxout_symbol, dbxout_common_check): Likewise. * expr.c (expand_assignment, expand_expr_real_2, expand_expr_real_1, string_constant): Likewise. * hsa.c (hsa_get_declaration_name): Likewise. * passes.c (rest_of_decl_compilation): Likewise. * tree-ssanames.c (make_ssa_name_fn): Likewise. * tree-streamer-out.c (pack_ts_decl_common_value_fields, pack_ts_decl_with_vis_value_fields, write_ts_decl_common_tree_pointers): Likewise. * stor-layout.c (place_field): Likewise. * symtab.c (symtab_node::maybe_create_reference, symtab_node::verify_base, symtab_node::make_decl_local, symtab_node::copy_visibility_from, symtab_node::can_increase_alignment_p): Likewise. * dwarf2out.c (add_var_loc_to_decl, tls_mem_loc_descriptor, decl_by_reference_p, reference_to_unused, rtl_for_decl_location, fortran_common, add_location_or_const_value_attribute, add_scalar_info, add_linkage_name, set_block_abstract_flags, local_function_static, gen_variable_die, dwarf2out_late_global_decl, optimize_one_addr_into_implicit_ptr, optimize_location_into_implicit_ptr): Likewise. * gimple-low.c (record_vars_into): Likewise. * ipa-visibility.c (update_vtable_references): Likewise. * tree-ssa-address.c (fixed_address_object_p, copy_ref_info): Likewise. * lto-streamer-out.c (tree_is_indexable, get_symbol_initial_value, DFS::DFS_write_tree_body, write_symbol): Likewise. * langhooks.c (lhd_warn_unused_global_decl, lhd_set_decl_assembler_name): Likewise. * attribs.c (decl_attributes): Likewise. * except.c (output_ttype): Likewise. * varpool.c (varpool_node::get_create, ctor_for_folding, varpool_node::assemble_decl, varpool_node::create_alias): Likewise. * fold-const.c (fold_unary_loc): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge, ipa_find_agg_cst_from_init): Likewise. * omp-low.c (expand_omp_regimplify_p, expand_omp_taskreg, expand_omp_target, lower_omp_regimplify_p, grid_reg_assignment_to_local_var_p, grid_remap_prebody_decls, find_link_var_op): Likewise. * tree-chrec.c (chrec_contains_symbols): Likewise. * tree-cfg.c (verify_address, verify_expr, verify_expr_location_1, gimple_duplicate_bb, move_stmt_op, replace_block_vars_by_duplicates, execute_fixup_cfg): Likewise. From-SVN: r240900
2016-10-09 13:19:48 +02:00
if (!VAR_P (scalar)
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
|| !is_global_var (scalar)
|| !TREE_READONLY (scalar)
|| !DECL_INITIAL (scalar)
|| TREE_CODE (DECL_INITIAL (scalar)) != CONSTRUCTOR)
return NULL;
return find_constructor_constant_at_offset (DECL_INITIAL (scalar), offset);
}
/* Retrieve value from aggregate jump function AGG or static initializer of
SCALAR (which can be NULL) for the given OFFSET or return NULL if there is
none. BY_REF specifies whether the value has to be passed by reference or
by value. If FROM_GLOBAL_CONSTANT is non-NULL, then the boolean it points
to is set to true if the value comes from an initializer of a constant. */
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
tree
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *agg, tree scalar,
HOST_WIDE_INT offset, bool by_ref,
bool *from_global_constant)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
struct ipa_agg_jf_item *item;
int i;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
if (scalar)
{
tree res = ipa_find_agg_cst_from_init (scalar, offset, by_ref);
if (res)
{
if (from_global_constant)
*from_global_constant = true;
return res;
}
}
if (!agg
|| by_ref != agg->by_ref)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return NULL;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_SAFE_ELT (agg->items, i, item)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
if (item->offset == offset)
{
/* Currently we do not have clobber values, return NULL for them once
we do. */
gcc_checking_assert (is_gimple_ip_invariant (item->value));
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
if (from_global_constant)
*from_global_constant = false;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
return item->value;
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
return NULL;
}
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
/* Remove a reference to SYMBOL from the list of references of a node given by
reference description RDESC. Return true if the reference has been
successfully found and removed. */
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
static bool
Automated part of renaming of symtab_node_base to symtab_node. gcc/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 with ChangeLog entry fixed up by hand. * cgraph.c (x_cgraph_nodes_queue): Rename symtab_node_base to symtab_node. (cgraph_node_for_asm): Likewise. * cgraph.h (symtab_node_base): Likewise. (cgraph_node): Likewise. (varpool_node): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (is_a_helper <varpool_node>::test): Likewise. (symtab_nodes): Likewise. (symtab_register_node): Likewise. (symtab_unregister_node): Likewise. (symtab_remove_node): Likewise. (symtab_get_node): Likewise. (symtab_node_for_asm): Likewise. (symtab_node_asm_name): Likewise. (symtab_node_name): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (dump_symtab_node): Likewise. (debug_symtab_node): Likewise. (dump_symtab_base): Likewise. (verify_symtab_node): Likewise. (verify_symtab_base): Likewise. (symtab_used_from_object_file_p): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_nonoverwritable_alias): Likewise. (availability symtab_node_availability): Likewise. (symtab_semantically_equivalent_p): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_prevail_in_asm_name_hash): Likewise. (cgraph): Likewise. (varpool): Likewise. (varpool_first_variable): Likewise. (varpool_next_variable): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_defined_variable): Likewise. (cgraph_first_defined_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (symtab_alias_target): Likewise. (symtab_real_symbol_p): Likewise. (symtab_can_be_discarded): Likewise. * cgraphbuild.c (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. * cgraphunit.c (decide_is_symbol_needed): Likewise. (first): Likewise. (enqueue_node): Likewise. (referred_to_p): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_functions): Likewise. (handle_alias_pairs): Likewise. (output_weakrefs): Likewise. (compile): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (try_decrement_rdesc_refcount): Likewise. (ipa_edge_duplication_hook): Likewise. * ipa-ref.c (ipa_record_reference): Likewise. (ipa_maybe_record_reference): Likewise. (ipa_clone_ref): Likewise. (ipa_clone_references): Likewise. (ipa_clone_referring): Likewise. (ipa_find_reference): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_clear_stmts_in_references): Likewise. * ipa-ref.h (symtab_node_base): Likewise. (ipa_ref): Likewise. (ipa_record_reference): Likewise. (ipa_maybe_record_reference): Likewise. (ipa_clone_references): Likewise. (ipa_clone_referring): Likewise. (ipa_clone_ref): Likewise. (ipa_find_reference): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_clear_stmts_in_references): Likewise. * ipa-reference.c (ipa_reference_write_optimization_summary): Likewise. * ipa.c (enqueue_node): Likewise. (process_references): Likewise. (walk_polymorphic_call_targets): Likewise. (symtab_remove_unreachable_nodes): Likewise. (address_taken_from_non_vtable_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (comdat_can_be_unshared_p): Likewise. (can_replace_by_local_alias): Likewise. (function_and_variable_visibility): Likewise. * is-a.h: Likewise (within example in comment). * lto-cgraph.c (input_cgraph_opt_summary): Likewise. (lto_symtab_encoder_encode): Likewise. (lto_symtab_encoder_delete_node): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Likewise. (output_symtab): Likewise. (input_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (input_cgraph_1): Likewise. (input_refs): Likewise. (output_cgraph_opt_summary): Likewise. (input_node_opt_summary): Likewise. (input_cgraph_opt_section): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-out.c (lto_output): Likewise. (output_symbol_p): Likewise. (produce_symtab): Likewise. * lto-streamer.h (lto_encoder_entry): Likewise. (lto_free_function_in_decl_state_for_node): Likewise. (lto_symtab_encoder_encode): Likewise. (lto_symtab_encoder_delete_node): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_lookup): Likewise. (lsei_node): Likewise. (lto_symtab_encoder_deref): Likewise. * symtab.c (symtab_hash): Likewise. (assembler_name_hash): Likewise. (symtab_nodes): Likewise. (hash_node): Likewise. (eq_node): Likewise. (hash_node_by_assembler_name): Likewise. (eq_assembler_name): Likewise. (insert_to_assembler_name_hash): Likewise. (unlink_from_assembler_name_hash): Likewise. (symtab_prevail_in_asm_name_hash): Likewise. (symtab_register_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_unregister_node): Likewise. (symtab_get_node): Likewise. (symtab_remove_node): Likewise. (symtab_initialize_asm_name_hash): Likewise. (symtab_node_for_asm): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_node_asm_name): Likewise. (symtab_node_name): Likewise. (dump_symtab_base): Likewise. (dump_symtab_node): Likewise. (dump_symtab): Likewise. (debug_symtab_node): Likewise. (verify_symtab_base): Likewise. (verify_symtab_node): Likewise. (verify_symtab): Likewise. (symtab_used_from_object_file_p): Likewise. (symtab_node_availability): Likewise. (symtab_alias_ultimate_target): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_resolve_alias): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_semantically_equivalent_p): Likewise. * value-prof.c (init_node_map): Likewise. * varasm.c (find_decl): Likewise. * varpool.c (varpool_node_for_asm): Likewise. (varpool_remove_unreferenced_decls): Likewise. gcc/c-family/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-pragma.c (maybe_apply_pending_pragma_weaks): Rename symtab_node_base to symtab_node. gcc/lto/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (add_symbol_to_partition): Rename symtab_node_base to symtab_node. (get_symbol_class): Likewise. (symbol_partitioned_p): Likewise. (add_references_to_partition): Likewise. (add_symbol_to_partition_1): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition): Likewise. (lto_1_to_1_map): Likewise. (lto_max_map): Likewise. (lto_balanced_map): Likewise. (privatize_symbol_name): Likewise. (promote_symbol): Likewise. (may_need_named_section_p): Likewise. (rename_statics): Likewise. (lto_promote_statics_nonwpa): Likewise. * lto-symtab.c (lto_symtab_merge): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_prevailing_decl): Likewise. * lto.c (lto_wpa_write_files): Likewise. (read_cgraph_and_symbols): Likewise. (do_whole_program_analysis): Likewise. From-SVN: r204279
2013-10-31 22:26:14 +01:00
remove_described_reference (symtab_node *symbol, struct ipa_cst_ref_desc *rdesc)
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
{
struct ipa_ref *to_del;
struct cgraph_edge *origin;
origin = rdesc->cs;
if (!origin)
return false;
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
to_del = origin->caller->find_reference (symbol, origin->call_stmt,
origin->lto_stmt_uid);
if (!to_del)
return false;
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
to_del->remove_reference ();
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
if (dump_file)
fprintf (dump_file, "ipa-prop: Removed a reference from %s/%i to %s.\n",
xstrdup_for_dump (origin->caller->name ()),
origin->caller->order, xstrdup_for_dump (symbol->name ()));
return true;
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
}
/* If JFUNC has a reference description with refcount different from
IPA_UNDESCRIBED_USE, return the reference description, otherwise return
NULL. JFUNC must be a constant jump function. */
static struct ipa_cst_ref_desc *
jfunc_rdesc_usable (struct ipa_jump_func *jfunc)
{
struct ipa_cst_ref_desc *rdesc = ipa_get_jf_constant_rdesc (jfunc);
if (rdesc && rdesc->refcount != IPA_UNDESCRIBED_USE)
return rdesc;
else
return NULL;
}
/* If the value of constant jump function JFUNC is an address of a function
declaration, return the associated call graph node. Otherwise return
NULL. */
static cgraph_node *
cgraph_node_for_jfunc (struct ipa_jump_func *jfunc)
{
gcc_checking_assert (jfunc->type == IPA_JF_CONST);
tree cst = ipa_get_jf_constant (jfunc);
if (TREE_CODE (cst) != ADDR_EXPR
|| TREE_CODE (TREE_OPERAND (cst, 0)) != FUNCTION_DECL)
return NULL;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
return cgraph_node::get (TREE_OPERAND (cst, 0));
}
/* If JFUNC is a constant jump function with a usable rdesc, decrement its
refcount and if it hits zero, remove reference to SYMBOL from the caller of
the edge specified in the rdesc. Return false if either the symbol or the
reference could not be found, otherwise return true. */
static bool
try_decrement_rdesc_refcount (struct ipa_jump_func *jfunc)
{
struct ipa_cst_ref_desc *rdesc;
if (jfunc->type == IPA_JF_CONST
&& (rdesc = jfunc_rdesc_usable (jfunc))
&& --rdesc->refcount == 0)
{
Automated part of renaming of symtab_node_base to symtab_node. gcc/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 with ChangeLog entry fixed up by hand. * cgraph.c (x_cgraph_nodes_queue): Rename symtab_node_base to symtab_node. (cgraph_node_for_asm): Likewise. * cgraph.h (symtab_node_base): Likewise. (cgraph_node): Likewise. (varpool_node): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (is_a_helper <varpool_node>::test): Likewise. (symtab_nodes): Likewise. (symtab_register_node): Likewise. (symtab_unregister_node): Likewise. (symtab_remove_node): Likewise. (symtab_get_node): Likewise. (symtab_node_for_asm): Likewise. (symtab_node_asm_name): Likewise. (symtab_node_name): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (dump_symtab_node): Likewise. (debug_symtab_node): Likewise. (dump_symtab_base): Likewise. (verify_symtab_node): Likewise. (verify_symtab_base): Likewise. (symtab_used_from_object_file_p): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_nonoverwritable_alias): Likewise. (availability symtab_node_availability): Likewise. (symtab_semantically_equivalent_p): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_prevail_in_asm_name_hash): Likewise. (cgraph): Likewise. (varpool): Likewise. (varpool_first_variable): Likewise. (varpool_next_variable): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_defined_variable): Likewise. (cgraph_first_defined_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (symtab_alias_target): Likewise. (symtab_real_symbol_p): Likewise. (symtab_can_be_discarded): Likewise. * cgraphbuild.c (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. * cgraphunit.c (decide_is_symbol_needed): Likewise. (first): Likewise. (enqueue_node): Likewise. (referred_to_p): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_functions): Likewise. (handle_alias_pairs): Likewise. (output_weakrefs): Likewise. (compile): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (try_decrement_rdesc_refcount): Likewise. (ipa_edge_duplication_hook): Likewise. * ipa-ref.c (ipa_record_reference): Likewise. (ipa_maybe_record_reference): Likewise. (ipa_clone_ref): Likewise. (ipa_clone_references): Likewise. (ipa_clone_referring): Likewise. (ipa_find_reference): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_clear_stmts_in_references): Likewise. * ipa-ref.h (symtab_node_base): Likewise. (ipa_ref): Likewise. (ipa_record_reference): Likewise. (ipa_maybe_record_reference): Likewise. (ipa_clone_references): Likewise. (ipa_clone_referring): Likewise. (ipa_clone_ref): Likewise. (ipa_find_reference): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_clear_stmts_in_references): Likewise. * ipa-reference.c (ipa_reference_write_optimization_summary): Likewise. * ipa.c (enqueue_node): Likewise. (process_references): Likewise. (walk_polymorphic_call_targets): Likewise. (symtab_remove_unreachable_nodes): Likewise. (address_taken_from_non_vtable_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (comdat_can_be_unshared_p): Likewise. (can_replace_by_local_alias): Likewise. (function_and_variable_visibility): Likewise. * is-a.h: Likewise (within example in comment). * lto-cgraph.c (input_cgraph_opt_summary): Likewise. (lto_symtab_encoder_encode): Likewise. (lto_symtab_encoder_delete_node): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Likewise. (output_symtab): Likewise. (input_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (input_cgraph_1): Likewise. (input_refs): Likewise. (output_cgraph_opt_summary): Likewise. (input_node_opt_summary): Likewise. (input_cgraph_opt_section): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-out.c (lto_output): Likewise. (output_symbol_p): Likewise. (produce_symtab): Likewise. * lto-streamer.h (lto_encoder_entry): Likewise. (lto_free_function_in_decl_state_for_node): Likewise. (lto_symtab_encoder_encode): Likewise. (lto_symtab_encoder_delete_node): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_lookup): Likewise. (lsei_node): Likewise. (lto_symtab_encoder_deref): Likewise. * symtab.c (symtab_hash): Likewise. (assembler_name_hash): Likewise. (symtab_nodes): Likewise. (hash_node): Likewise. (eq_node): Likewise. (hash_node_by_assembler_name): Likewise. (eq_assembler_name): Likewise. (insert_to_assembler_name_hash): Likewise. (unlink_from_assembler_name_hash): Likewise. (symtab_prevail_in_asm_name_hash): Likewise. (symtab_register_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_unregister_node): Likewise. (symtab_get_node): Likewise. (symtab_remove_node): Likewise. (symtab_initialize_asm_name_hash): Likewise. (symtab_node_for_asm): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_node_asm_name): Likewise. (symtab_node_name): Likewise. (dump_symtab_base): Likewise. (dump_symtab_node): Likewise. (dump_symtab): Likewise. (debug_symtab_node): Likewise. (verify_symtab_base): Likewise. (verify_symtab_node): Likewise. (verify_symtab): Likewise. (symtab_used_from_object_file_p): Likewise. (symtab_node_availability): Likewise. (symtab_alias_ultimate_target): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_resolve_alias): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_semantically_equivalent_p): Likewise. * value-prof.c (init_node_map): Likewise. * varasm.c (find_decl): Likewise. * varpool.c (varpool_node_for_asm): Likewise. (varpool_remove_unreferenced_decls): Likewise. gcc/c-family/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-pragma.c (maybe_apply_pending_pragma_weaks): Rename symtab_node_base to symtab_node. gcc/lto/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (add_symbol_to_partition): Rename symtab_node_base to symtab_node. (get_symbol_class): Likewise. (symbol_partitioned_p): Likewise. (add_references_to_partition): Likewise. (add_symbol_to_partition_1): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition): Likewise. (lto_1_to_1_map): Likewise. (lto_max_map): Likewise. (lto_balanced_map): Likewise. (privatize_symbol_name): Likewise. (promote_symbol): Likewise. (may_need_named_section_p): Likewise. (rename_statics): Likewise. (lto_promote_statics_nonwpa): Likewise. * lto-symtab.c (lto_symtab_merge): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_prevailing_decl): Likewise. * lto.c (lto_wpa_write_files): Likewise. (read_cgraph_and_symbols): Likewise. (do_whole_program_analysis): Likewise. From-SVN: r204279
2013-10-31 22:26:14 +01:00
symtab_node *symbol = cgraph_node_for_jfunc (jfunc);
if (!symbol)
return false;
return remove_described_reference (symbol, rdesc);
}
return true;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
/* Try to find a destination for indirect edge IE that corresponds to a simple
call or a call of a member function pointer and where the destination is a
pointer formal parameter described by jump function JFUNC. If it can be
determined, return the newly direct edge, otherwise return NULL.
NEW_ROOT_INFO is the node info that JFUNC lattices are relative to. */
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
static struct cgraph_edge *
try_make_edge_direct_simple_call (struct cgraph_edge *ie,
struct ipa_jump_func *jfunc,
struct ipa_node_params *new_root_info)
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
{
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
struct cgraph_edge *cs;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
tree target;
cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraph.c (cgraph_update_edge_in_call_site_hash): New function. (cgraph_add_edge_to_call_site_hash): Deal with speculative calls. (cgraph_set_call_stmt): Likewise. (cgraph_create_edge_1): Fix release checking compilatoin; clear lto_stmt_uid. (cgraph_free_edge): Free indirect info. (cgraph_turn_edge_to_speculative): New function. (cgraph_speculative_call_info): New function. (cgraph_make_edge_direct): Return direct edge; handle speculation. (cgraph_redirect_edge_call_stmt_to_callee): Expand speculative edges. (dump_cgraph_node): Dump speculation. (verify_edge_count_and_frequency): Accept speculative edges. (verify_edge_corresponds_to_fndecl): Handle partitioned cgraph. (verify_cgraph_node): Handle speculation. * cgraph.h (cgraph_edge): Add SPECULATIVE flag. (cgraph_set_call_stmt): Update prototype. (cgraph_make_edge_direct): Update prototype. (cgraph_speculative_call_info): Declare. * ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge to change; update call of ipa_find_references. * ipa-ref.c (ipa_record_reference): Fix return value; clear lto_stmt_uid and speculative flags. (ipa_dump_references): Dump speculation. (ipa_clone_references): Clone speculative flag. (ipa_clone_referring): Likewise. (ipa_clone_ref): New function. (ipa_find_reference): Look into lto_stmt_uids (ipa_clear_stmts_in_references): Do not clear speculative calls. * ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags. (ipa_find_reference): Update declaration. (ipa_clone_ref): Declare. * lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0; stream speculative flag. (lto_output_ref): Stream statements uids and speculation. (input_ref): Likewise. (input_edge): Stream speuclation. * cgraphclones.c (cgraph_clone_edge): Clone speculation. (cgraph_set_call_stmt_including_clones): Handle speculation. * ipa-inline.c (heap_edge_removal_hook): New function. (inline_small_functions): Register it. * lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking; also initialize refs. * ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for edge to change. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_simple_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Look proper lto_stmt_uid. (propagate_controlled_uses): Likewise. (propagate_controlled_uses): Liekwise. * tree-inline.c (copy_bb): Copy speculative edges. (redirect_all_calls): New function. (copy_cfg_body): Do redirection after loop info is updated. (delete_unreachable_blocks_update_callgraph): Updadte speculation. From-SVN: r201632
2013-08-09 17:23:19 +02:00
bool agg_contents = ie->indirect_info->agg_contents;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
tree scalar = ipa_value_from_jfunc (new_root_info, jfunc);
if (agg_contents)
{
bool from_global_constant;
target = ipa_find_agg_cst_for_param (&jfunc->agg, scalar,
ie->indirect_info->offset,
ie->indirect_info->by_ref,
&from_global_constant);
if (target
&& !from_global_constant
&& !ie->indirect_info->guaranteed_unmodified)
return NULL;
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
else
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
target = scalar;
if (!target)
return NULL;
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
cs = ipa_make_edge_direct_to_target (ie, target);
if (cs && !agg_contents)
{
bool ok;
gcc_checking_assert (cs->callee
&& (cs != ie
|| jfunc->type != IPA_JF_CONST
|| !cgraph_node_for_jfunc (jfunc)
|| cs->callee == cgraph_node_for_jfunc (jfunc)));
ok = try_decrement_rdesc_refcount (jfunc);
gcc_checking_assert (ok);
}
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
return cs;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
/* Return the target to be used in cases of impossible devirtualization. IE
and target (the latter can be NULL) are dumped when dumping is enabled. */
tree
ipa_impossible_devirt_target (struct cgraph_edge *ie, tree target)
{
if (dump_file)
{
if (target)
fprintf (dump_file,
"Type inconsistent devirtualization: %s/%i->%s\n",
ie->caller->name (), ie->caller->order,
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target)));
else
fprintf (dump_file,
"No devirtualization target in %s/%i\n",
ie->caller->name (), ie->caller->order);
}
tree new_target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
cgraph_node::get_create (new_target);
return new_target;
}
/* Try to find a destination for indirect edge IE that corresponds to a virtual
call based on a formal parameter which is described by jump function JFUNC
and if it can be determined, make it direct and return the direct edge.
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
Otherwise, return NULL. CTX describes the polymorphic context that the
parameter the call is based on brings along with it. */
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
static struct cgraph_edge *
try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
struct ipa_jump_func *jfunc,
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
struct ipa_polymorphic_call_context ctx)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
tree target = NULL;
bool speculative = false;
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
if (!opt_for_fn (ie->caller->decl, flag_devirtualize))
return NULL;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
gcc_assert (!ie->indirect_info->by_ref);
/* Try to do lookup via known virtual table pointer value. */
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
if (!ie->indirect_info->vptr_changed
|| opt_for_fn (ie->caller->decl, flag_devirtualize_speculatively))
{
tree vtable;
unsigned HOST_WIDE_INT offset;
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
tree scalar = (jfunc->type == IPA_JF_CONST) ? ipa_get_jf_constant (jfunc)
: NULL;
tree t = ipa_find_agg_cst_for_param (&jfunc->agg, scalar,
ie->indirect_info->offset,
true);
if (t && vtable_pointer_value_to_vtable (t, &vtable, &offset))
{
bool can_refer;
t = gimple_get_virt_method_for_vtable (ie->indirect_info->otr_token,
vtable, offset, &can_refer);
if (can_refer)
{
if (!t
|| (TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE
&& DECL_FUNCTION_CODE (t) == BUILT_IN_UNREACHABLE)
|| !possible_polymorphic_call_target_p
(ie, cgraph_node::get (t)))
{
/* Do not speculate builtin_unreachable, it is stupid! */
if (!ie->indirect_info->vptr_changed)
target = ipa_impossible_devirt_target (ie, target);
else
target = NULL;
}
else
{
target = t;
speculative = ie->indirect_info->vptr_changed;
}
}
}
}
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
ipa_polymorphic_call_context ie_context (ie);
vec <cgraph_node *>targets;
bool final;
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
ctx.offset_by (ie->indirect_info->offset);
if (ie->indirect_info->vptr_changed)
ctx.possible_dynamic_type_change (ie->in_polymorphic_cdtor,
ie->indirect_info->otr_type);
ctx.combine_with (ie_context, ie->indirect_info->otr_type);
targets = possible_polymorphic_call_targets
(ie->indirect_info->otr_type,
ie->indirect_info->otr_token,
ctx, &final);
if (final && targets.length () <= 1)
{
speculative = false;
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
if (targets.length () == 1)
target = targets[0]->decl;
else
target = ipa_impossible_devirt_target (ie, NULL_TREE);
}
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
else if (!target && opt_for_fn (ie->caller->decl, flag_devirtualize_speculatively)
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
&& !ie->speculative && ie->maybe_hot_p ())
{
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
cgraph_node *n;
n = try_speculative_devirtualization (ie->indirect_info->otr_type,
ie->indirect_info->otr_token,
ie->indirect_info->context);
if (n)
{
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
target = n->decl;
speculative = true;
}
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (target)
{
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
if (!possible_polymorphic_call_target_p
(ie, cgraph_node::get_create (target)))
{
if (speculative)
return NULL;
target = ipa_impossible_devirt_target (ie, target);
}
return ipa_make_edge_direct_to_target (ie, target, speculative);
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
else
return NULL;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
/* Update the param called notes associated with NODE when CS is being inlined,
assuming NODE is (potentially indirectly) inlined into CS->callee.
Moreover, if the callee is discovered to be constant, create a new cgraph
edge for it. Newly discovered indirect edges will be added to *NEW_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
unless NEW_EDGES is NULL. Return true iff a new edge(s) were created. */
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
static bool
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
update_indirect_edges_after_inlining (struct cgraph_edge *cs,
struct cgraph_node *node,
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
vec<cgraph_edge *> *new_edges)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
struct ipa_edge_args *top;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
struct cgraph_edge *ie, *next_ie, *new_direct_edge;
struct ipa_node_params *new_root_info;
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
bool res = false;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
ipa_check_create_edge_args ();
top = IPA_EDGE_REF (cs);
new_root_info = IPA_NODE_REF (cs->caller->global.inlined_to
? cs->caller->global.inlined_to
: cs->caller);
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
for (ie = node->indirect_calls; ie; ie = next_ie)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
struct cgraph_indirect_call_info *ici = ie->indirect_info;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
struct ipa_jump_func *jfunc;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
int param_index;
cgraph_node *spec_target = NULL;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
next_ie = ie->next_callee;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
if (ici->param_index == -1)
continue;
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
/* We must check range due to calls with variable number of arguments: */
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
if (ici->param_index >= ipa_get_cs_argument_count (top))
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
ici->param_index = -1;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
continue;
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
param_index = ici->param_index;
jfunc = ipa_get_ith_jump_func (top, param_index);
if (ie->speculative)
{
struct cgraph_edge *de;
struct ipa_ref *ref;
ie->speculative_call_info (de, ie, ref);
spec_target = de->callee;
}
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
if (!opt_for_fn (node->decl, flag_indirect_inlining))
new_direct_edge = NULL;
else if (ici->polymorphic)
{
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
ipa_polymorphic_call_context ctx;
ctx = ipa_context_from_jfunc (new_root_info, cs, param_index, jfunc);
new_direct_edge = try_make_edge_direct_virtual_call (ie, jfunc, ctx);
}
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
else
new_direct_edge = try_make_edge_direct_simple_call (ie, jfunc,
new_root_info);
cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraph.c (cgraph_update_edge_in_call_site_hash): New function. (cgraph_add_edge_to_call_site_hash): Deal with speculative calls. (cgraph_set_call_stmt): Likewise. (cgraph_create_edge_1): Fix release checking compilatoin; clear lto_stmt_uid. (cgraph_free_edge): Free indirect info. (cgraph_turn_edge_to_speculative): New function. (cgraph_speculative_call_info): New function. (cgraph_make_edge_direct): Return direct edge; handle speculation. (cgraph_redirect_edge_call_stmt_to_callee): Expand speculative edges. (dump_cgraph_node): Dump speculation. (verify_edge_count_and_frequency): Accept speculative edges. (verify_edge_corresponds_to_fndecl): Handle partitioned cgraph. (verify_cgraph_node): Handle speculation. * cgraph.h (cgraph_edge): Add SPECULATIVE flag. (cgraph_set_call_stmt): Update prototype. (cgraph_make_edge_direct): Update prototype. (cgraph_speculative_call_info): Declare. * ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge to change; update call of ipa_find_references. * ipa-ref.c (ipa_record_reference): Fix return value; clear lto_stmt_uid and speculative flags. (ipa_dump_references): Dump speculation. (ipa_clone_references): Clone speculative flag. (ipa_clone_referring): Likewise. (ipa_clone_ref): New function. (ipa_find_reference): Look into lto_stmt_uids (ipa_clear_stmts_in_references): Do not clear speculative calls. * ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags. (ipa_find_reference): Update declaration. (ipa_clone_ref): Declare. * lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0; stream speculative flag. (lto_output_ref): Stream statements uids and speculation. (input_ref): Likewise. (input_edge): Stream speuclation. * cgraphclones.c (cgraph_clone_edge): Clone speculation. (cgraph_set_call_stmt_including_clones): Handle speculation. * ipa-inline.c (heap_edge_removal_hook): New function. (inline_small_functions): Register it. * lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking; also initialize refs. * ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for edge to change. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_simple_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Look proper lto_stmt_uid. (propagate_controlled_uses): Likewise. (propagate_controlled_uses): Liekwise. * tree-inline.c (copy_bb): Copy speculative edges. (redirect_all_calls): New function. (copy_cfg_body): Do redirection after loop info is updated. (delete_unreachable_blocks_update_callgraph): Updadte speculation. From-SVN: r201632
2013-08-09 17:23:19 +02:00
/* If speculation was removed, then we need to do nothing. */
if (new_direct_edge && new_direct_edge != ie
&& new_direct_edge->callee == spec_target)
cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraph.c (cgraph_update_edge_in_call_site_hash): New function. (cgraph_add_edge_to_call_site_hash): Deal with speculative calls. (cgraph_set_call_stmt): Likewise. (cgraph_create_edge_1): Fix release checking compilatoin; clear lto_stmt_uid. (cgraph_free_edge): Free indirect info. (cgraph_turn_edge_to_speculative): New function. (cgraph_speculative_call_info): New function. (cgraph_make_edge_direct): Return direct edge; handle speculation. (cgraph_redirect_edge_call_stmt_to_callee): Expand speculative edges. (dump_cgraph_node): Dump speculation. (verify_edge_count_and_frequency): Accept speculative edges. (verify_edge_corresponds_to_fndecl): Handle partitioned cgraph. (verify_cgraph_node): Handle speculation. * cgraph.h (cgraph_edge): Add SPECULATIVE flag. (cgraph_set_call_stmt): Update prototype. (cgraph_make_edge_direct): Update prototype. (cgraph_speculative_call_info): Declare. * ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge to change; update call of ipa_find_references. * ipa-ref.c (ipa_record_reference): Fix return value; clear lto_stmt_uid and speculative flags. (ipa_dump_references): Dump speculation. (ipa_clone_references): Clone speculative flag. (ipa_clone_referring): Likewise. (ipa_clone_ref): New function. (ipa_find_reference): Look into lto_stmt_uids (ipa_clear_stmts_in_references): Do not clear speculative calls. * ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags. (ipa_find_reference): Update declaration. (ipa_clone_ref): Declare. * lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0; stream speculative flag. (lto_output_ref): Stream statements uids and speculation. (input_ref): Likewise. (input_edge): Stream speuclation. * cgraphclones.c (cgraph_clone_edge): Clone speculation. (cgraph_set_call_stmt_including_clones): Handle speculation. * ipa-inline.c (heap_edge_removal_hook): New function. (inline_small_functions): Register it. * lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking; also initialize refs. * ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for edge to change. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_simple_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Look proper lto_stmt_uid. (propagate_controlled_uses): Likewise. (propagate_controlled_uses): Liekwise. * tree-inline.c (copy_bb): Copy speculative edges. (redirect_all_calls): New function. (copy_cfg_body): Do redirection after loop info is updated. (delete_unreachable_blocks_update_callgraph): Updadte speculation. From-SVN: r201632
2013-08-09 17:23:19 +02:00
{
new_direct_edge->indirect_inlining_edge = 1;
top = IPA_EDGE_REF (cs);
res = true;
if (!new_direct_edge->speculative)
continue;
cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraph.c (cgraph_update_edge_in_call_site_hash): New function. (cgraph_add_edge_to_call_site_hash): Deal with speculative calls. (cgraph_set_call_stmt): Likewise. (cgraph_create_edge_1): Fix release checking compilatoin; clear lto_stmt_uid. (cgraph_free_edge): Free indirect info. (cgraph_turn_edge_to_speculative): New function. (cgraph_speculative_call_info): New function. (cgraph_make_edge_direct): Return direct edge; handle speculation. (cgraph_redirect_edge_call_stmt_to_callee): Expand speculative edges. (dump_cgraph_node): Dump speculation. (verify_edge_count_and_frequency): Accept speculative edges. (verify_edge_corresponds_to_fndecl): Handle partitioned cgraph. (verify_cgraph_node): Handle speculation. * cgraph.h (cgraph_edge): Add SPECULATIVE flag. (cgraph_set_call_stmt): Update prototype. (cgraph_make_edge_direct): Update prototype. (cgraph_speculative_call_info): Declare. * ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge to change; update call of ipa_find_references. * ipa-ref.c (ipa_record_reference): Fix return value; clear lto_stmt_uid and speculative flags. (ipa_dump_references): Dump speculation. (ipa_clone_references): Clone speculative flag. (ipa_clone_referring): Likewise. (ipa_clone_ref): New function. (ipa_find_reference): Look into lto_stmt_uids (ipa_clear_stmts_in_references): Do not clear speculative calls. * ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags. (ipa_find_reference): Update declaration. (ipa_clone_ref): Declare. * lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0; stream speculative flag. (lto_output_ref): Stream statements uids and speculation. (input_ref): Likewise. (input_edge): Stream speuclation. * cgraphclones.c (cgraph_clone_edge): Clone speculation. (cgraph_set_call_stmt_including_clones): Handle speculation. * ipa-inline.c (heap_edge_removal_hook): New function. (inline_small_functions): Register it. * lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking; also initialize refs. * ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for edge to change. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_simple_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Look proper lto_stmt_uid. (propagate_controlled_uses): Likewise. (propagate_controlled_uses): Liekwise. * tree-inline.c (copy_bb): Copy speculative edges. (redirect_all_calls): New function. (copy_cfg_body): Do redirection after loop info is updated. (delete_unreachable_blocks_update_callgraph): Updadte speculation. From-SVN: r201632
2013-08-09 17:23:19 +02:00
}
else if (new_direct_edge)
{
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
new_direct_edge->indirect_inlining_edge = 1;
if (new_direct_edge->call_stmt)
new_direct_edge->call_stmt_cannot_inline_p
= !gimple_check_call_matching_types (
new_direct_edge->call_stmt,
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
new_direct_edge->callee->decl, false);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (new_edges)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
new_edges->safe_push (new_direct_edge);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
res = true;
}
cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraphbuild.c (cgraph_rebuild_references): Rebuild only non-speculative refs. * cgraph.c (cgraph_update_edge_in_call_site_hash): New function. (cgraph_add_edge_to_call_site_hash): Deal with speculative calls. (cgraph_set_call_stmt): Likewise. (cgraph_create_edge_1): Fix release checking compilatoin; clear lto_stmt_uid. (cgraph_free_edge): Free indirect info. (cgraph_turn_edge_to_speculative): New function. (cgraph_speculative_call_info): New function. (cgraph_make_edge_direct): Return direct edge; handle speculation. (cgraph_redirect_edge_call_stmt_to_callee): Expand speculative edges. (dump_cgraph_node): Dump speculation. (verify_edge_count_and_frequency): Accept speculative edges. (verify_edge_corresponds_to_fndecl): Handle partitioned cgraph. (verify_cgraph_node): Handle speculation. * cgraph.h (cgraph_edge): Add SPECULATIVE flag. (cgraph_set_call_stmt): Update prototype. (cgraph_make_edge_direct): Update prototype. (cgraph_speculative_call_info): Declare. * ipa-cp.c (ipcp_discover_new_direct_edges): Be ready for edge to change; update call of ipa_find_references. * ipa-ref.c (ipa_record_reference): Fix return value; clear lto_stmt_uid and speculative flags. (ipa_dump_references): Dump speculation. (ipa_clone_references): Clone speculative flag. (ipa_clone_referring): Likewise. (ipa_clone_ref): New function. (ipa_find_reference): Look into lto_stmt_uids (ipa_clear_stmts_in_references): Do not clear speculative calls. * ipa-ref.h (ipa_ref): Add lto_stmt_uid and speculative flags. (ipa_find_reference): Update declaration. (ipa_clone_ref): Declare. * lto-cgraph.c (lto_output_edge): Make lto_stmt_uids start from 0; stream speculative flag. (lto_output_ref): Stream statements uids and speculation. (input_ref): Likewise. (input_edge): Stream speuclation. * cgraphclones.c (cgraph_clone_edge): Clone speculation. (cgraph_set_call_stmt_including_clones): Handle speculation. * ipa-inline.c (heap_edge_removal_hook): New function. (inline_small_functions): Register it. * lto-streamer-in.c (fixup_call_stmt_edges_1): Bounds checking; also initialize refs. * ipa-prop.c (ipa_make_edge_direct_to_target): Be ready for edge to change. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_simple_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Look proper lto_stmt_uid. (propagate_controlled_uses): Likewise. (propagate_controlled_uses): Liekwise. * tree-inline.c (copy_bb): Copy speculative edges. (redirect_all_calls): New function. (copy_cfg_body): Do redirection after loop info is updated. (delete_unreachable_blocks_update_callgraph): Updadte speculation. From-SVN: r201632
2013-08-09 17:23:19 +02:00
top = IPA_EDGE_REF (cs);
/* If speculative edge was introduced we still need to update
call info of the indirect edge. */
if (!new_direct_edge->speculative)
continue;
}
if (jfunc->type == IPA_JF_PASS_THROUGH
&& ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
{
if (ici->agg_contents
&& !ipa_get_jf_pass_through_agg_preserved (jfunc)
&& !ici->polymorphic)
ici->param_index = -1;
else
{
ici->param_index = ipa_get_jf_pass_through_formal_id (jfunc);
if (ici->polymorphic
&& !ipa_get_jf_pass_through_type_preserved (jfunc))
ici->vptr_changed = true;
}
}
else if (jfunc->type == IPA_JF_ANCESTOR)
{
if (ici->agg_contents
&& !ipa_get_jf_ancestor_agg_preserved (jfunc)
&& !ici->polymorphic)
ici->param_index = -1;
else
{
ici->param_index = ipa_get_jf_ancestor_formal_id (jfunc);
ici->offset += ipa_get_jf_ancestor_offset (jfunc);
if (ici->polymorphic
&& !ipa_get_jf_ancestor_type_preserved (jfunc))
ici->vptr_changed = true;
}
}
else
/* Either we can find a destination for this edge now or never. */
ici->param_index = -1;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05: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
return res;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
/* Recursively traverse subtree of NODE (including node) made of inlined
cgraph_edges when CS has been inlined and invoke
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
update_indirect_edges_after_inlining on all nodes and
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
update_jump_functions_after_inlining on all non-inlined edges that lead out
of this subtree. Newly discovered indirect edges will be added to
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
*NEW_EDGES, unless NEW_EDGES is NULL. Return true iff a new edge(s) were
created. */
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
static bool
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
propagate_info_to_inlined_callees (struct cgraph_edge *cs,
struct cgraph_node *node,
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
vec<cgraph_edge *> *new_edges)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
struct cgraph_edge *e;
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
bool res;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
res = update_indirect_edges_after_inlining (cs, node, new_edges);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
for (e = node->callees; e; e = e->next_callee)
if (!e->inline_failed)
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
res |= propagate_info_to_inlined_callees (cs, e->callee, new_edges);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
else
update_jump_functions_after_inlining (cs, e);
for (e = node->indirect_calls; e; e = e->next_callee)
update_jump_functions_after_inlining (cs, e);
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
return res;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
/* Combine two controlled uses counts as done during inlining. */
static int
combine_controlled_uses_counters (int c, int d)
{
if (c == IPA_UNDESCRIBED_USE || d == IPA_UNDESCRIBED_USE)
return IPA_UNDESCRIBED_USE;
else
return c + d - 1;
}
/* Propagate number of controlled users from CS->caleee to the new root of the
tree of inlined nodes. */
static void
propagate_controlled_uses (struct cgraph_edge *cs)
{
struct ipa_edge_args *args = IPA_EDGE_REF (cs);
struct cgraph_node *new_root = cs->caller->global.inlined_to
? cs->caller->global.inlined_to : cs->caller;
struct ipa_node_params *new_root_info = IPA_NODE_REF (new_root);
struct ipa_node_params *old_root_info = IPA_NODE_REF (cs->callee);
int count, i;
count = MIN (ipa_get_cs_argument_count (args),
ipa_get_param_count (old_root_info));
for (i = 0; i < count; i++)
{
struct ipa_jump_func *jf = ipa_get_ith_jump_func (args, i);
struct ipa_cst_ref_desc *rdesc;
if (jf->type == IPA_JF_PASS_THROUGH)
{
int src_idx, c, d;
src_idx = ipa_get_jf_pass_through_formal_id (jf);
c = ipa_get_controlled_uses (new_root_info, src_idx);
d = ipa_get_controlled_uses (old_root_info, i);
gcc_checking_assert (ipa_get_jf_pass_through_operation (jf)
== NOP_EXPR || c == IPA_UNDESCRIBED_USE);
c = combine_controlled_uses_counters (c, d);
ipa_set_controlled_uses (new_root_info, src_idx, c);
if (c == 0 && new_root_info->ipcp_orig_node)
{
struct cgraph_node *n;
struct ipa_ref *ref;
ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_get_jf_pass_through_type_preserved): use agg_preserved flag instead. (ipa_get_jf_ancestor_type_preserved): Likewise. (ipa_node_params): Rename known_vals to known_csts, update all users. New field known_contexts. (ipa_get_indirect_edge_target): Update prototype. (ipcp_poly_ctx_values_pool): Declare. (ipa_context_from_jfunc): Likewise. * ipa-inline.h (estimate_ipcp_clone_size_and_time): Updated prototype. * cgraph.h (ipa_polymorphic_call_context): New method equal_to. New parameter newline of method dump. * ipa-cp.c (ctxlat): New field. (ipcp_values_pool): Renamed to ipcp_cst_values_pool, updated all users. (ipcp_poly_ctx_values_pool):New variable. (ipa_get_poly_ctx_lat): New function. (print_ipcp_constant_value): New overloaded function for contexts. (print_all_lattices): Also print contexts. (ipa_topo_info): New field contexts; (set_all_contains_variable): Also set the flag in the context lattice. (initialize_node_lattices): Likewise for flag bottom. (ipa_get_jf_ancestor_result): Removed BINFO handling. (ipa_value_from_jfunc): Likewise. (ipa_context_from_jfunc): New function. (values_equal_for_ipcp_p): New overloaded function for contexts. (allocate_and_init_ipcp_value): Construct the value. (allocate_and_init_ipcp_value): New overloaded function for contexts. (propagate_scalar_accross_jump_function): Removed handling of KNOWN_TYPE jump functions. (propagate_context_accross_jump_function): New function. (propagate_constants_accross_call): Also propagate contexts. (ipa_get_indirect_edge_target_1): Work on contexts rather than BINFOs. (ipa_get_indirect_edge_target): Likewise. (devirtualization_time_bonus): Likewise. (gather_context_independent_values): Create and populate known_contexts vector rather than known_binfos. (perform_estimation_of_a_value): Work on contexts rather than BINFOs. (estimate_local_effects): Likewise. (add_all_node_vals_to_toposort): Also add contexts to teir topological sort. (ipcp_propagate_stage): Also propagate effects of contexts. (ipcp_discover_new_direct_edges): Receive and pass known_contexts to ipa_get_indirect_edge_target_1. (cgraph_edge_brings_value_p): New overloaded function for contexts. (create_specialized_node): Work on contexts rather than BINFOs. (find_more_contexts_for_caller_subset): New function. (known_contexts_useful_p): New function. (copy_useful_known_contexts): Likewise. (modify_known_vectors_with_val): Likewise. (ipcp_val_in_agg_replacements_p): Renamed to ipcp_val_agg_replacement_ok_p, return true for all offset indicating non-aggregate. (ipcp_val_agg_replacement_ok_p): New overloaded function for contexts. (decide_about_value): Work on contexts rather than BINFOs. (decide_whether_version_node): Likewise. (ipcp_driver): Initialize the new alloc pool. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Prettify printing of edge contexts. (ipa_set_ancestor_jf): Replace assert with conditional setting of type_preserved to false. (update_jump_functions_after_inlining): Use access function instead of reading agg_preserved directly. Store combined context in the ancestor case. (try_make_edge_direct_virtual_call): Work on contexts rather than BINFOs. (update_indirect_edges_after_inlining): Get context from ipa_context_from_jfunc. (ipa_free_node_params_substructures): Free also known_contexts. (ipa_free_all_structures_after_ipa_cp): Free the new alloc pool. (ipa_free_all_structures_after_iinln): Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): Work on contexts rather than BINFOs. (estimate_edge_devirt_benefit): Likewise. (estimate_edge_size_and_time): Likewise. (estimate_calls_size_and_time): Likewise. (estimate_node_size_and_time): Likewise. (estimate_ipcp_clone_size_and_time): Likewise. (do_estimate_edge_time): Likewise. (do_estimate_edge_size): Likewise. (do_estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::dump): New parameter newline, ouput newline only when it is set. (ipa_polymorphic_call_context::equal_to): New method. testsuite/ * g++.dg/ipa/devirt-11.C: Dont't run ipa-cp, remove times constraint from the dump scan. * g++.dg/ipa/devirt-21.C: Xfail. * g++.dg/ipa/devirt-24.C: Likewise. * g++.dg/ipa/devirt-10.C: Removed times constraint from the dump scan. * g++.dg/ipa/devirt-41.C: Updated the dump scan. * g++.dg/ipa/devirt-44.C: Likewise. * g++.dg/ipa/devirt-43.C: Xfail. From-SVN: r217587
2014-11-14 21:03:19 +01:00
tree t = new_root_info->known_csts[src_idx];
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
if (t && TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
&& (n = cgraph_node::get (TREE_OPERAND (t, 0)))
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
&& (ref = new_root->find_reference (n, NULL, 0)))
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Removing cloning-created "
"reference from %s/%i to %s/%i.\n",
xstrdup_for_dump (new_root->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
new_root->order,
xstrdup_for_dump (n->name ()), n->order);
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
ref->remove_reference ();
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
}
}
}
else if (jf->type == IPA_JF_CONST
&& (rdesc = jfunc_rdesc_usable (jf)))
{
int d = ipa_get_controlled_uses (old_root_info, i);
int c = rdesc->refcount;
rdesc->refcount = combine_controlled_uses_counters (c, d);
if (rdesc->refcount == 0)
{
tree cst = ipa_get_jf_constant (jf);
struct cgraph_node *n;
gcc_checking_assert (TREE_CODE (cst) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (cst, 0))
== FUNCTION_DECL);
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
n = cgraph_node::get (TREE_OPERAND (cst, 0));
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
if (n)
{
struct cgraph_node *clone;
bool ok;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
ok = remove_described_reference (n, rdesc);
gcc_checking_assert (ok);
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
clone = cs->caller;
while (clone->global.inlined_to
&& clone != rdesc->cs->caller
&& IPA_NODE_REF (clone)->ipcp_orig_node)
{
struct ipa_ref *ref;
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
ref = clone->find_reference (n, NULL, 0);
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
if (ref)
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Removing "
"cloning-created reference "
"from %s/%i to %s/%i.\n",
xstrdup_for_dump (clone->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
clone->order,
xstrdup_for_dump (n->name ()),
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
n->order);
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
ref->remove_reference ();
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
}
clone = clone->callers->caller;
}
}
}
}
}
for (i = ipa_get_param_count (old_root_info);
i < ipa_get_cs_argument_count (args);
i++)
{
struct ipa_jump_func *jf = ipa_get_ith_jump_func (args, i);
if (jf->type == IPA_JF_CONST)
{
struct ipa_cst_ref_desc *rdesc = jfunc_rdesc_usable (jf);
if (rdesc)
rdesc->refcount = IPA_UNDESCRIBED_USE;
}
else if (jf->type == IPA_JF_PASS_THROUGH)
ipa_set_controlled_uses (new_root_info,
jf->value.pass_through.formal_id,
IPA_UNDESCRIBED_USE);
}
}
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
/* Update jump functions and call note functions on inlining the call site CS.
CS is expected to lead to a node already cloned by
cgraph_clone_inline_nodes. Newly discovered indirect edges will be added to
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
*NEW_EDGES, unless NEW_EDGES is NULL. Return true iff a new edge(s) were +
created. */
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
bool
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
vec<cgraph_edge *> *new_edges)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
bool changed;
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
/* Do nothing if the preparation phase has not been carried out yet
(i.e. during early inlining). */
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
if (!ipa_node_params_sum)
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
return false;
gcc_assert (ipa_edge_args_vector);
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
propagate_controlled_uses (cs);
changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
return changed;
}
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
/* Ensure that array of edge arguments infos is big enough to accommodate a
structure for all edges and reallocates it if not. Also, allocate
associated hash tables is they do not already exist. */
void
ipa_check_create_edge_args (void)
{
if (vec_safe_length (ipa_edge_args_vector)
<= (unsigned) symtab->edges_max_uid)
vec_safe_grow_cleared (ipa_edge_args_vector, symtab->edges_max_uid + 1);
if (!ipa_bits_hash_table)
ipa_bits_hash_table = hash_table<ipa_bit_ggc_hash_traits>::create_ggc (37);
if (!ipa_vr_hash_table)
ipa_vr_hash_table = hash_table<ipa_vr_ggc_hash_traits>::create_ggc (37);
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Frees all dynamically allocated structures that the argument info points
to. */
void
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_free_edge_args_substructures (struct ipa_edge_args *args)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_free (args->jump_functions);
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
memset (args, 0, sizeof (*args));
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Free all ipa_edge structures. */
void
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_free_all_edge_args (void)
{
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
int i;
struct ipa_edge_args *args;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
if (!ipa_edge_args_vector)
return;
FOR_EACH_VEC_ELT (*ipa_edge_args_vector, i, args)
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_free_edge_args_substructures (args);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_free (ipa_edge_args_vector);
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Free all ipa_node_params structures. */
void
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_free_all_node_params (void)
{
ipa_node_params_sum->release ();
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
ipa_node_params_sum = NULL;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
}
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
/* Grow ipcp_transformations if necessary. Also allocate any necessary hash
tables if they do not already exist. */
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
void
ipcp_grow_transformations_if_necessary (void)
{
if (vec_safe_length (ipcp_transformations)
<= (unsigned) symtab->cgraph_max_uid)
vec_safe_grow_cleared (ipcp_transformations, symtab->cgraph_max_uid + 1);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (!ipa_bits_hash_table)
ipa_bits_hash_table = hash_table<ipa_bit_ggc_hash_traits>::create_ggc (37);
if (!ipa_vr_hash_table)
ipa_vr_hash_table = hash_table<ipa_vr_ggc_hash_traits>::create_ggc (37);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
/* Set the aggregate replacements of NODE to be AGGVALS. */
void
ipa_set_node_agg_value_chain (struct cgraph_node *node,
struct ipa_agg_replacement_value *aggvals)
{
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipcp_grow_transformations_if_necessary ();
(*ipcp_transformations)[node->uid].agg_values = aggvals;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Hook that is called by cgraph.c when an edge is removed. */
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
static void
ipa_edge_removal_hook (struct cgraph_edge *cs, void *data ATTRIBUTE_UNUSED)
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
{
struct ipa_edge_args *args;
/* During IPA-CP updating we can be called on not-yet analyzed clones. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
if (vec_safe_length (ipa_edge_args_vector) <= (unsigned)cs->uid)
return;
args = IPA_EDGE_REF (cs);
if (args->jump_functions)
{
struct ipa_jump_func *jf;
int i;
FOR_EACH_VEC_ELT (*args->jump_functions, i, jf)
{
struct ipa_cst_ref_desc *rdesc;
try_decrement_rdesc_refcount (jf);
if (jf->type == IPA_JF_CONST
&& (rdesc = ipa_get_jf_constant_rdesc (jf))
&& rdesc->cs == cs)
rdesc->cs = NULL;
}
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_free_edge_args_substructures (IPA_EDGE_REF (cs));
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
/* Hook that is called by cgraph.c when an edge is duplicated. */
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
static void
ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst,
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
void *)
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
{
struct ipa_edge_args *old_args, *new_args;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
unsigned int i;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_check_create_edge_args ();
old_args = IPA_EDGE_REF (src);
new_args = IPA_EDGE_REF (dst);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
new_args->jump_functions = vec_safe_copy (old_args->jump_functions);
if (old_args->polymorphic_call_contexts)
new_args->polymorphic_call_contexts
= vec_safe_copy (old_args->polymorphic_call_contexts);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
for (i = 0; i < vec_safe_length (old_args->jump_functions); i++)
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
{
struct ipa_jump_func *src_jf = ipa_get_ith_jump_func (old_args, i);
struct ipa_jump_func *dst_jf = ipa_get_ith_jump_func (new_args, i);
dst_jf->agg.items = vec_safe_copy (dst_jf->agg.items);
if (src_jf->type == IPA_JF_CONST)
{
struct ipa_cst_ref_desc *src_rdesc = jfunc_rdesc_usable (src_jf);
if (!src_rdesc)
dst_jf->value.constant.rdesc = NULL;
else if (src->caller == dst->caller)
{
struct ipa_ref *ref;
Automated part of renaming of symtab_node_base to symtab_node. gcc/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 with ChangeLog entry fixed up by hand. * cgraph.c (x_cgraph_nodes_queue): Rename symtab_node_base to symtab_node. (cgraph_node_for_asm): Likewise. * cgraph.h (symtab_node_base): Likewise. (cgraph_node): Likewise. (varpool_node): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (is_a_helper <varpool_node>::test): Likewise. (symtab_nodes): Likewise. (symtab_register_node): Likewise. (symtab_unregister_node): Likewise. (symtab_remove_node): Likewise. (symtab_get_node): Likewise. (symtab_node_for_asm): Likewise. (symtab_node_asm_name): Likewise. (symtab_node_name): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (dump_symtab_node): Likewise. (debug_symtab_node): Likewise. (dump_symtab_base): Likewise. (verify_symtab_node): Likewise. (verify_symtab_base): Likewise. (symtab_used_from_object_file_p): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_nonoverwritable_alias): Likewise. (availability symtab_node_availability): Likewise. (symtab_semantically_equivalent_p): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_prevail_in_asm_name_hash): Likewise. (cgraph): Likewise. (varpool): Likewise. (varpool_first_variable): Likewise. (varpool_next_variable): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_defined_variable): Likewise. (cgraph_first_defined_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (symtab_alias_target): Likewise. (symtab_real_symbol_p): Likewise. (symtab_can_be_discarded): Likewise. * cgraphbuild.c (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. * cgraphunit.c (decide_is_symbol_needed): Likewise. (first): Likewise. (enqueue_node): Likewise. (referred_to_p): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_functions): Likewise. (handle_alias_pairs): Likewise. (output_weakrefs): Likewise. (compile): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (try_decrement_rdesc_refcount): Likewise. (ipa_edge_duplication_hook): Likewise. * ipa-ref.c (ipa_record_reference): Likewise. (ipa_maybe_record_reference): Likewise. (ipa_clone_ref): Likewise. (ipa_clone_references): Likewise. (ipa_clone_referring): Likewise. (ipa_find_reference): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_clear_stmts_in_references): Likewise. * ipa-ref.h (symtab_node_base): Likewise. (ipa_ref): Likewise. (ipa_record_reference): Likewise. (ipa_maybe_record_reference): Likewise. (ipa_clone_references): Likewise. (ipa_clone_referring): Likewise. (ipa_clone_ref): Likewise. (ipa_find_reference): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_clear_stmts_in_references): Likewise. * ipa-reference.c (ipa_reference_write_optimization_summary): Likewise. * ipa.c (enqueue_node): Likewise. (process_references): Likewise. (walk_polymorphic_call_targets): Likewise. (symtab_remove_unreachable_nodes): Likewise. (address_taken_from_non_vtable_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (comdat_can_be_unshared_p): Likewise. (can_replace_by_local_alias): Likewise. (function_and_variable_visibility): Likewise. * is-a.h: Likewise (within example in comment). * lto-cgraph.c (input_cgraph_opt_summary): Likewise. (lto_symtab_encoder_encode): Likewise. (lto_symtab_encoder_delete_node): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Likewise. (output_symtab): Likewise. (input_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (input_cgraph_1): Likewise. (input_refs): Likewise. (output_cgraph_opt_summary): Likewise. (input_node_opt_summary): Likewise. (input_cgraph_opt_section): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-out.c (lto_output): Likewise. (output_symbol_p): Likewise. (produce_symtab): Likewise. * lto-streamer.h (lto_encoder_entry): Likewise. (lto_free_function_in_decl_state_for_node): Likewise. (lto_symtab_encoder_encode): Likewise. (lto_symtab_encoder_delete_node): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_lookup): Likewise. (lsei_node): Likewise. (lto_symtab_encoder_deref): Likewise. * symtab.c (symtab_hash): Likewise. (assembler_name_hash): Likewise. (symtab_nodes): Likewise. (hash_node): Likewise. (eq_node): Likewise. (hash_node_by_assembler_name): Likewise. (eq_assembler_name): Likewise. (insert_to_assembler_name_hash): Likewise. (unlink_from_assembler_name_hash): Likewise. (symtab_prevail_in_asm_name_hash): Likewise. (symtab_register_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_unregister_node): Likewise. (symtab_get_node): Likewise. (symtab_remove_node): Likewise. (symtab_initialize_asm_name_hash): Likewise. (symtab_node_for_asm): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_node_asm_name): Likewise. (symtab_node_name): Likewise. (dump_symtab_base): Likewise. (dump_symtab_node): Likewise. (dump_symtab): Likewise. (debug_symtab_node): Likewise. (verify_symtab_base): Likewise. (verify_symtab_node): Likewise. (verify_symtab): Likewise. (symtab_used_from_object_file_p): Likewise. (symtab_node_availability): Likewise. (symtab_alias_ultimate_target): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_resolve_alias): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_semantically_equivalent_p): Likewise. * value-prof.c (init_node_map): Likewise. * varasm.c (find_decl): Likewise. * varpool.c (varpool_node_for_asm): Likewise. (varpool_remove_unreferenced_decls): Likewise. gcc/c-family/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-pragma.c (maybe_apply_pending_pragma_weaks): Rename symtab_node_base to symtab_node. gcc/lto/ Patch autogenerated by rename_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (add_symbol_to_partition): Rename symtab_node_base to symtab_node. (get_symbol_class): Likewise. (symbol_partitioned_p): Likewise. (add_references_to_partition): Likewise. (add_symbol_to_partition_1): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition): Likewise. (lto_1_to_1_map): Likewise. (lto_max_map): Likewise. (lto_balanced_map): Likewise. (privatize_symbol_name): Likewise. (promote_symbol): Likewise. (may_need_named_section_p): Likewise. (rename_statics): Likewise. (lto_promote_statics_nonwpa): Likewise. * lto-symtab.c (lto_symtab_merge): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_prevailing_decl): Likewise. * lto.c (lto_wpa_write_files): Likewise. (read_cgraph_and_symbols): Likewise. (do_whole_program_analysis): Likewise. From-SVN: r204279
2013-10-31 22:26:14 +01:00
symtab_node *n = cgraph_node_for_jfunc (src_jf);
gcc_checking_assert (n);
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
ref = src->caller->find_reference (n, src->call_stmt,
src->lto_stmt_uid);
gcc_checking_assert (ref);
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
dst->caller->clone_reference (ref, ref->stmt);
struct ipa_cst_ref_desc *dst_rdesc = ipa_refdesc_pool.allocate ();
dst_rdesc->cs = dst;
dst_rdesc->refcount = src_rdesc->refcount;
dst_rdesc->next_duplicate = NULL;
dst_jf->value.constant.rdesc = dst_rdesc;
}
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
else if (src_rdesc->cs == src)
{
struct ipa_cst_ref_desc *dst_rdesc = ipa_refdesc_pool.allocate ();
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
dst_rdesc->cs = dst;
dst_rdesc->refcount = src_rdesc->refcount;
dst_rdesc->next_duplicate = src_rdesc->next_duplicate;
src_rdesc->next_duplicate = dst_rdesc;
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
dst_jf->value.constant.rdesc = dst_rdesc;
}
else
{
struct ipa_cst_ref_desc *dst_rdesc;
/* This can happen during inlining, when a JFUNC can refer to a
reference taken in a function up in the tree of inline clones.
We need to find the duplicate that refers to our tree of
inline clones. */
gcc_assert (dst->caller->global.inlined_to);
for (dst_rdesc = src_rdesc->next_duplicate;
dst_rdesc;
dst_rdesc = dst_rdesc->next_duplicate)
{
struct cgraph_node *top;
top = dst_rdesc->cs->caller->global.inlined_to
? dst_rdesc->cs->caller->global.inlined_to
: dst_rdesc->cs->caller;
if (dst->caller->global.inlined_to == top)
break;
}
gcc_assert (dst_rdesc);
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
dst_jf->value.constant.rdesc = dst_rdesc;
}
}
else if (dst_jf->type == IPA_JF_PASS_THROUGH
&& src->caller == dst->caller)
{
struct cgraph_node *inline_root = dst->caller->global.inlined_to
? dst->caller->global.inlined_to : dst->caller;
struct ipa_node_params *root_info = IPA_NODE_REF (inline_root);
int idx = ipa_get_jf_pass_through_formal_id (dst_jf);
int c = ipa_get_controlled_uses (root_info, idx);
if (c != IPA_UNDESCRIBED_USE)
{
c++;
ipa_set_controlled_uses (root_info, idx, c);
}
}
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
}
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
/* Analyze newly added function into callgraph. */
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
static void
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
ipa_add_new_function (cgraph_node *node, void *data ATTRIBUTE_UNUSED)
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
{
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
if (node->has_gimple_body_p ())
ipa_analyze_node (node);
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
/* Hook that is called by summary when a node is duplicated. */
void
ipa_node_params_t::duplicate(cgraph_node *src, cgraph_node *dst,
ipa_node_params *old_info,
ipa_node_params *new_info)
{
ipa_agg_replacement_value *old_av, *new_av;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
new_info->descriptors = vec_safe_copy (old_info->descriptors);
ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. 2011-07-18 Martin Jambor <mjambor@suse.cz> * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. (ipcp_values_pool): Declare. (ipcp_sources_pool): Likewise. (ipcp_lattice): Changed to forward declaration. (ipa_param_descriptor): Removed fields ipcp_lattice, types and cannot_devirtualize. (ipa_node_params): New fields descriptors, lattices, known_vals, clone_for_all_contexts and node dead, removed fields params and count_scale. (ipa_set_param_count): Removed. (ipa_get_param_count): Made to work with descriptors vector. (ipa_get_param): Updated. (ipa_param_cannot_devirtualize_p): Removed. (ipa_param_types_vec_empty): Likewise. (ipa_set_param_used): New function. (ipa_get_param_used): Updated to use descriptors vector. (ipa_func_list): Removed. (ipa_init_func_list): Removed declaration. (ipa_push_func_to_list_1): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_push_func_to_list): Removed. (ipa_lattice_from_jfunc): Remove declaration. (ipa_get_jf_pass_through_result): Declare. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_get_lattice): Update. (ipa_lat_is_single_const): New function. * ipa-prop.c (ipa_push_func_to_list_1): Removed. (ipa_init_func_list): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_get_param_decl_index): Fix coding style. (count_formal_params): Removed. (count_formal_params_1): Renamed to count_formal_params. (ipa_populate_param_decls): Update to use descriptors vector. (ipa_initialize_node_params): Likewise. (visit_ref_for_mod_analysis): Use ipa_set_param_used. (ipa_analyze_params_uses): Likewise. (ipa_free_node_params_substructures): Likewise and free also lattices and known values. (duplicate_array): Removed. (ipa_edge_duplication_hook): Add the new edge to the list of edge clones. (ipa_node_duplication_hook): Update to use new lattices. (ipa_free_all_structures_after_ipa_cp): Free alloc pools. (ipa_free_all_structures_after_iinln): Likewise. (ipa_write_node_info): Update to use new lattices. (ipa_read_node_info): Likewise. (ipa_get_jf_pass_through_result): New function. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc. * ipa-cp.c: Reimplemented. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed. (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter. (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise. * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies. * doc/invoke.texi (devirt-type-list-size): Removed description. (ipa-cp-value-list-size): Added description. * testsuite/gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-2.c: Likewise. * testsuite/gcc.dg/ipa/ipa-3.c: Likewise and made functions static. * testsuite/gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-5.c: Likewise. * testsuite/gcc.dg/ipa/ipa-7.c: Likewise. * testsuite/gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipacost-1.c: Likewise. * testsuite/gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some functions. * testsuite/gcc.dg/ipa/ipcp-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-2.c: Likewise. * testsuite/gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. From-SVN: r176424
2011-07-19 00:03:39 +02:00
new_info->lattices = NULL;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
new_info->ipcp_orig_node = old_info->ipcp_orig_node;
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
new_info->known_csts = old_info->known_csts.copy ();
new_info->known_contexts = old_info->known_contexts.copy ();
ipa-prop.h (enum ipa_lattice_type): Changed comments. 2010-08-05 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (enum ipa_lattice_type): Changed comments. (struct ipa_param_descriptor): New fields types and cannot_devirtualize. (ipa_param_cannot_devirtualize_p): New function. (ipa_param_types_vec_empty): Likewise. (ipa_make_edge_direct_to_target): Declare. * ipa-cp.c: Fixed first stage driver name in initial comment, described devirtualization there too. (ipcp_analyze_node): Call ipa_analyze_params_uses. (ipcp_print_all_lattices): Print devirtualization info. (ipa_set_param_cannot_devirtualize): New function. (ipcp_initialize_node_lattices): Set cannot_devirtualize when setting lattice to BOTTOM. (ipcp_init_stage): Merged into... (ipcp_generate_summary): ...its caller. (ipcp_change_tops_to_bottom): Also process type lists. (ipcp_add_param_type): New function. (ipcp_copy_types): Likewise. (ipcp_propagate_types): Likewise. (ipcp_propagate_stage): Also propagate types. (ipcp_need_redirect_p): Variable jump_func moved to its scope block. Also return true if propagated types require it. (ipcp_update_callgraph): Dump redirection info. (ipcp_process_devirtualization_opportunities): New function. (ipcp_const_param_count): Include known type information. (ipcp_insert_stage): Call ipcp_process_devirtualization_opportunities on new node. Fixed formatting. * ipa-prop.c (make_edge_direct_to_target): Renamed to ipa_make_edge_direct_to_target and changed all callers. Made externally visible. (ipa_node_duplication_hook): Duplicate types vector. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Also try to redirect outgoing calls for which we can't get a decl from the statement. Check that we can get a decl from the call statement. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses only when ipa-cp is disabled. * tree-inline.c (get_indirect_callee_fndecl): Removed. (expand_call_inline): Do not call get_indirect_callee_fndecl. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): New parameter. * Makefile.in (ipa-cp.o): Add gimple.h to dependencies. * testsuite/g++.dg/ipa/devirt-1.C: New test. * testsuite/g++.dg/ipa/devirt-2.C: Likewise. * testsuite/g++.dg/ipa/devirt-3.C: Likewise. * testsuite/g++.dg/ipa/devirt-4.C: Likewise. * testsuite/g++.dg/ipa/devirt-5.C: Likewise. * testsuite/gcc.dg/ipa/iinline-3.c: Likewise. From-SVN: r162911
2010-08-05 15:23:07 +02:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
new_info->analysis_done = old_info->analysis_done;
ipa-prop.h (enum ipa_lattice_type): Changed comments. 2010-08-05 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (enum ipa_lattice_type): Changed comments. (struct ipa_param_descriptor): New fields types and cannot_devirtualize. (ipa_param_cannot_devirtualize_p): New function. (ipa_param_types_vec_empty): Likewise. (ipa_make_edge_direct_to_target): Declare. * ipa-cp.c: Fixed first stage driver name in initial comment, described devirtualization there too. (ipcp_analyze_node): Call ipa_analyze_params_uses. (ipcp_print_all_lattices): Print devirtualization info. (ipa_set_param_cannot_devirtualize): New function. (ipcp_initialize_node_lattices): Set cannot_devirtualize when setting lattice to BOTTOM. (ipcp_init_stage): Merged into... (ipcp_generate_summary): ...its caller. (ipcp_change_tops_to_bottom): Also process type lists. (ipcp_add_param_type): New function. (ipcp_copy_types): Likewise. (ipcp_propagate_types): Likewise. (ipcp_propagate_stage): Also propagate types. (ipcp_need_redirect_p): Variable jump_func moved to its scope block. Also return true if propagated types require it. (ipcp_update_callgraph): Dump redirection info. (ipcp_process_devirtualization_opportunities): New function. (ipcp_const_param_count): Include known type information. (ipcp_insert_stage): Call ipcp_process_devirtualization_opportunities on new node. Fixed formatting. * ipa-prop.c (make_edge_direct_to_target): Renamed to ipa_make_edge_direct_to_target and changed all callers. Made externally visible. (ipa_node_duplication_hook): Duplicate types vector. * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Also try to redirect outgoing calls for which we can't get a decl from the statement. Check that we can get a decl from the call statement. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses only when ipa-cp is disabled. * tree-inline.c (get_indirect_callee_fndecl): Removed. (expand_call_inline): Do not call get_indirect_callee_fndecl. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): New parameter. * Makefile.in (ipa-cp.o): Add gimple.h to dependencies. * testsuite/g++.dg/ipa/devirt-1.C: New test. * testsuite/g++.dg/ipa/devirt-2.C: Likewise. * testsuite/g++.dg/ipa/devirt-3.C: Likewise. * testsuite/g++.dg/ipa/devirt-4.C: Likewise. * testsuite/g++.dg/ipa/devirt-5.C: Likewise. * testsuite/gcc.dg/ipa/iinline-3.c: Likewise. From-SVN: r162911
2010-08-05 15:23:07 +02:00
new_info->node_enqueued = old_info->node_enqueued;
new_info->versionable = old_info->versionable;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
old_av = ipa_get_agg_replacements_for_node (src);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
if (old_av)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
{
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
new_av = NULL;
while (old_av)
{
struct ipa_agg_replacement_value *v;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
v = ggc_alloc<ipa_agg_replacement_value> ();
memcpy (v, old_av, sizeof (*v));
v->next = new_av;
new_av = v;
old_av = old_av->next;
}
ipa_set_node_agg_value_chain (dst, new_av);
}
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
ipcp_transformation_summary *src_trans
= ipcp_get_transformation_summary (src);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
if (src_trans)
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
{
ipcp_grow_transformations_if_necessary ();
src_trans = ipcp_get_transformation_summary (src);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
ipcp_transformation_summary *dst_trans
= ipcp_get_transformation_summary (dst);
dst_trans->bits = vec_safe_copy (src_trans->bits);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
const vec<ipa_vr, va_gc> *src_vr = src_trans->m_vr;
vec<ipa_vr, va_gc> *&dst_vr
= ipcp_get_transformation_summary (dst)->m_vr;
if (vec_safe_length (src_trans->m_vr) > 0)
{
vec_safe_reserve_exact (dst_vr, src_vr->length ());
for (unsigned i = 0; i < src_vr->length (); ++i)
dst_vr->quick_push ((*src_vr)[i]);
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
}
/* Register our cgraph hooks if they are not already there. */
void
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
ipa_register_cgraph_hooks (void)
{
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
ipa_check_create_node_params ();
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
if (!edge_removal_hook_holder)
edge_removal_hook_holder =
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
symtab->add_edge_removal_hook (&ipa_edge_removal_hook, NULL);
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
if (!edge_duplication_hook_holder)
edge_duplication_hook_holder =
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
symtab->add_edge_duplication_hook (&ipa_edge_duplication_hook, NULL);
ipa-prop uses symbol_summary class. * lto-partition.c: Include of symbol-summary.h is added. * lto-symtab.c: Likewise. * lto.c: Likewise. * auto-profile.c: Include of symbol-summary.h is added. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c (evaluate_properties_for_edge): New ipa_node_params_sum data structure is used. (inline_node_duplication_hook): Likewise. (estimate_function_body_sizes): Likewise. (remap_edge_change_prob): Likewise. (inline_merge_summary): Likewise. * ipa-inline-transform.c: Include of symbol-summary.h is added. * ipa-inline.c (early_inliner): New ipa_node_params_sum data structure is used. * ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added. * ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum data structure is used. (ipa_node_params::~ipa_node_params): New function. (ipa_free_all_node_params): Destruction is simplified. (ipa_node_removal_hook): Removed. (ipa_add_new_function): Renamed from ipa_node_duplication_hook. (ipa_node_params_t::duplicate): New function. (ipa_register_cgraph_hooks): Few hooks are removed. (ipa_unregister_cgraph_hooks): Likewise. (ipa_prop_write_jump_functions): New ipa_node_params_sum is used. * ipa-prop.h (struct ipa_node_params): Destructor introduced for the structure. (ipa_check_create_node_params): Vector for ipa_node_params is replaced with function_summary. * ipa-split.c: Include of symbol-summary.h is added. * ipa-utils.c: Include of symbol-summary.h is added. * ipa.c: Include of symbol-summary.h is added. * omp-low.c: Include of symbol-summary.h is added. * tree-inline.c: Include of symbol-summary.h is added. * tree-sra.c: Include of symbol-summary.h is added. * tree-ssa-pre.c: Include of symbol-summary.h is added. From-SVN: r219005
2014-12-22 10:19:09 +01:00
function_insertion_hook_holder =
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
symtab->add_cgraph_insertion_hook (&ipa_add_new_function, NULL);
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
}
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
/* Unregister our cgraph hooks if they are not already there. */
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
static void
ipa_unregister_cgraph_hooks (void)
{
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
symtab->remove_edge_removal_hook (edge_removal_hook_holder);
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
edge_removal_hook_holder = NULL;
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
symtab->remove_edge_duplication_hook (edge_duplication_hook_holder);
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
edge_duplication_hook_holder = NULL;
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder);
function_insertion_hook_holder = NULL;
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
}
/* Free all ipa_node_params and all ipa_edge_args structures if they are no
longer needed after ipa-cp. */
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
void
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
ipa_free_all_structures_after_ipa_cp (void)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. * ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn. (ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check. (ipa_get_indirect_edge_target_1): Use opt_for_fn. (good_cloning_opportunity_p): Likewise. (ipa-cp gate): Enable ipa-cp with LTO. * ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn. * ipa.c (symbol_table::remove_unreachable_nodes): Always build type inheritance. * ipa-inline-transform.c (inline_transform): Check if there are inlines to apply even at -O0. * cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn. (analyze_functions): Build type inheritance graph. * ipa-inline.c (can_inline_edge_p): Use opt_for_fn. (want_early_inline_function_p, want_inline_small_function_p): Likewise. (check_callers): Likewise. (edge_badness): Likewise. (inline_small_functions): Always be ready for indirect inlining to happend. (ipa_inline): Always use want_inline_function_to_all_callers_p. (early_inline_small_functions): Use opt_for_fn. * ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn. (estimate_function_body_sizes): Likewise. (compute_inline_parameters): Likewise. (estimate_edge_devirt_benefit): Likewise. (inline_analyze_function): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (gate): Use in_lto_p. * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn. (try_make_edge_direct_virtual_call): Likewise. (update_indirect_edges_after_inlining): Likewise. (ipa_free_all_structures_after_ipa_cp): Add in_lto_p check. * common.opt (findirect-inlining): Turn into optimization. * ipa-pure-const.c (add_new_function): Use opt_for_fn. (pure_const_generate_summary): Likewise. (gate_pure_const): Always enable with in_lto_p. From-SVN: r217737
2014-11-18 21:44:16 +01:00
if (!optimize && !in_lto_p)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipcp_sources_pool.release ();
ipcp_cst_values_pool.release ();
ipcp_poly_ctx_values_pool.release ();
ipcp_agg_lattice_pool.release ();
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
ipa_unregister_cgraph_hooks ();
ipa_refdesc_pool.release ();
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
}
/* Free all ipa_node_params and all ipa_edge_args structures if they are no
longer needed after indirect inlining. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
void
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
ipa_free_all_structures_after_iinln (void)
ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. 2008-07-08 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params instead of ipa_create_node_params. (ipcp_driver): Allocate infos with ipa_check_create_node_params and ipa_check_create_edge_args, free them with free_all_ipa_structures_after_ipa_cp, call ipa_register_cgraph_hooks. * ipa-prop.c: Include flags.h and tree-inline.h. (ipa_node_params_vector): New variable. (ipa_edge_args_vector): New variable. (edge_removal_hook_holder): New variable. (node_removal_hook_holder): New variable. (edge_duplication_hook_holder): New variable. (node_duplication_hook_holder): New variable. (ipa_detect_param_modifications): Check for presence of modified flags. (ipa_compute_jump_functions): Check for presence of jump functions. (ipa_free_edge_args_substructures): New function. (ipa_create_node_params): Removed. (ipa_free_all_edge_args): Changed to deallocate the on-the-side vector. (ipa_free_node_params_substructures): New function. (ipa_free_all_node_params): Changed to deallocate the on-the-side vector. (ipa_edge_removal_hook): New function. (ipa_node_removal_hook): New function. (duplicate_array): New function. (ipa_edge_duplication_hook): New function. (ipa_node_duplication_hook): New function. (ipa_register_cgraph_hooks): New function. (ipa_unregister_cgraph_hooks): New function. (free_all_ipa_structures_after_ipa_cp): New function. * ipa-prop.h: Include vec.h. (ipa_node_params_t): New typedef with vector types for it. (ipa_edge_args_t): New typedef with vector types for it. (IPA_NODE_REF): Changed to access an on-the-side vector. (IPA_EDGE_REF): Changed to access an on-the-side vector. (ipa_check_create_node_params): New function. (ipa_check_create_edge_args): New function. * Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted all users. From-SVN: r137620
2008-07-08 15:25:24 +02:00
{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipa_unregister_cgraph_hooks ();
ipcp_sources_pool.release ();
ipcp_cst_values_pool.release ();
ipcp_poly_ctx_values_pool.release ();
ipcp_agg_lattice_pool.release ();
ipa_refdesc_pool.release ();
}
ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg instead of setting number of formal... 2008-04-30 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg instead of setting number of formal parameters to zero. (ipcp_init_stage): Do not set the number of actual parameters to zero either. (ipcp_propagate_stage): Explicitly skipping all calls to nodes which are called with variable number of arguments. (ipcp_insert_stage): Explicitely skipping all nodes which are called with variable number of arguments. (ipcp_callsite_param_print): Skipps callsites to nodes with varaible number of parameters. * ipa-prop.h (struct ipa_node_params): Added flag called_with_var_arguments (ipa_set_param_count): Added. Changed sole setter to use it. (ipa_get_param_count): Added. All readers of param_count converted to use it instead. (ipa_set_called_with_variable_arg): Added. (ipa_is_called_with_var_arguments): Added. (ipa_get_ith_param): Added. All readers of param_decls converted to use it instead. (ipa_set_cs_argument_count): Added, sole writer to argument_count changed to use it. (ipa_get_cs_argument_count): Added, all readers of argument_count changed to cal it. (ipa_get_ith_jump_func): Added. Accessors of jump values changed to use it. * ipa-prop.h (struct ipcp_formal): Renamed to ipcp_lattice (struct ipcp_lattice): Renamed cval_type to type (struct ipa_node_params): ipcp_cval renamed to ipcp_lattices * ipa-cp.c (ipcp_cval_get_cvalue): Changed return value to tree (ipcp_cval_set_cvalue): Changed type of parameter value to tree (ipcp_insert_stage): Changed the type of variable cvalue to tree (ipcp_replace_map_create): Changed the type of parameter cvalue to tree (build_const_val): Changed the type of parameter cvalue to tree (ipcp_propagate_const): Changed the type of parameter cvalue to tree (ipcp_method_cval_set_cvalue_type): Renamed parameter cval_type1 to type * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called constant * ipa-prop.c (ipa_methodlist_init): Renamed to ipa_init_func_list (ipa_methodlist_not_empty): Removed, the sole user now checks directly (ipa_add_method): Renamed to ipa_push_func_to_list (ipa_remove_method): Renamed to ipa_pop_func_from_list (ipa_callsite_param_count): Removed. (ipa_callsite_param_count_set): Removed. (ipa_callsite_param): Removed. (ipa_callsite_callee): Removed. (ipa_callsite_compute_param): Renamed to ipa_compute_jump_functions (ipa_callsite_compute_count): Renamed to ipa_count_arguments (ipa_method_formal_count): Removed. (ipa_method_formal_count_set): Removed. (ipa_method_get_tree): Removed. (ipa_method_tree_map_create): Removed. (ipa_method_compute_tree_map): Renamed to ipa_create_param_decls_array (ipa_create_param_decls_array): Creates the array itself (ipa_create_param_decls_array): Temporary variable info instead of a few dereferences. (ipa_method_formal_compute_count): Renamed to ipa_count_formal_params (ipa_method_compute_modify): Renamed to ipa_detect_param_modifications (get_type): Removed. (ipa_jf_get_info_type): Removed. (ipa_node_create): Renamed to ipa_create_node_params (ipa_free): Renamed to ipa_free_all_node_params (ipa_nodes_create): Renamed to ipa_create_all_node_params (ipa_edges_create): Renamed to ipa_create_all_edge_args (ipa_edges_free): Renamed to ipa_free_all_edge_args (ipa_nodes_free): Integrated into ipa_free_all_node_params and removed (ipa_free_all_node_params): Deallocation to jump_functions moved to ipa_free_all_edge_args (ipa_method_tree_print): Renamed to ipa_print_all_tree_maps (ipa_method_modify_print): Renamed to ipa_print_all_params_modified (ipa_create_methodlist_node): Removed. (ipa_methodlist_method): Removed. (ipa_methodlist_method_set): Removed. (ipa_methodlist_next_method): Removed. (ipa_methodlist_next_method_set): Removed. (ipa_method_is_modified): Removed. (ipa_method_modify_create): Removed. (ipa_method_modify_init): Temporary variable info instead of a few dereferences. (ipa_detect_param_modifications): Temporary variable info instead of a few dereferences. (ipa_compute_jump_functions): Temporary variable info instead of a few dereferences. (ipa_method_modify_set): Removed. (ipa_method_tree_map): Renamed to ipa_get_param_decl_index (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather than craph_node as the first parameter. (ipa_method_modify_stmt): Renamed to ipa_check_stmt_modifications (ipa_method_modify_init): Removed. (ipa_compute_jump_functions): Added a temp variable instead of repeatadly dereferencing the cgraph_edge.aux pointer (ipa_callsite_param_set_type): Removed. (ipa_compute_jump_functions): i renamed to index and moved to an inner block (ipa_callsite_param_set_info_type_formal): Removed. (ipa_callsite_param_set_info_type): Removed. (ipa_callsite_param_map_create): Removed. (ipa_callsite_tree): Removed. (ipa_callsite_caller): Removed. (ipa_pop_func_from_list): return_method removed to return_func * ipa-prop.h (enum cvalue_type): Renamed to ipa_lattice_type, prefixed all values with IPA_. Changed all users. (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN, CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF and FORMAL_IPATYPE IPA_PASS_THROUGH. (union parameter_info): Renamed to jump_func_value. (union jump_func_value): Renamed value to constant (struct ipa_jump_func): Renamed info_type to value (struct ipa_node): Renamed to ipa_node_params (struct ipa_node_params): Renamed ipa_arg_num to param_count (struct ipa_node_params): Renamed ipa_param_tree to param_decls (struct ipa_node_params): Renamed ipa_mod to modified_flags (struct ipa_edge): Renamed to ipa_edge_args (struct ipa_edge_args): Renamed ipa_param_num to argument_count (struct ipa_edge_args): Renamed ipa_param_map to jump_functions (struct ipa_methodlist): Renamed to ipa_func_list (struct ipa_func_list): method_p renamed to node, next_method renamed to next (ipa_methodlist_p): Removed, switched all users to struct pointer (IS_VALID_TREE_MAP_INDEX): Renamed to IS_VALID_JUMP_FUNC_INDEX From-SVN: r134818
2008-04-30 12:01:59 +02:00
/* Print ipa_tree_map data structures of all functions in the
callgraph to F. */
void
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
ipa_print_node_params (FILE *f, struct cgraph_node *node)
{
int i, count;
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
struct ipa_node_params *info;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
if (!node->definition)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
return;
info = IPA_NODE_REF (node);
ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header... 2013-05-15 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (ipa_print_node_jump_functions): Print symbol order in header, print symbol order instead of node uid, print more information about indirect edge targets. (ipa_make_edge_direct_to_target): Print symbol order instead of node uids. (ipa_make_edge_direct_to_target): Likewise. (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_print_node_params): Also print symbol order. (ipcp_transform_function): Print symbol order instead of node uids. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_get_create_real_symbol_node): Likewise. * ipa-cp.c (print_lattice): Likewise. (print_all_lattices): Likewise. (determine_versionability): Likewise. (initialize_node_lattices): Likewise. (estimate_local_effects): Likewise. (update_profiling_info): Likewise. (create_specialized_node): Likewise. (perhaps_add_new_callers): Likewise. (decide_about_value): Likewise. (decide_whether_version_node): Likewise. (identify_dead_nodes): Likewise. * ipa-inline-analysis.c (dump_inline_edge_summary): Likewise. (dump_inline_summary): Likewise. (estimate_node_size_and_time): Likewise. (inline_analyze_function): Likewise. * ipa-inline.c (report_inline_failed_reason): Likewise. (want_early_inline_function_p): Likewise. (edge_badness): Likewise. (update_edge_key): Likewise. (inline_small_functions): Likewise. Add dumping of order to two other dumps. * ipa-pure-const.c (pure_const_read_summary): Print symbol order instead of node uids. (propagate_pure_const): Likewise. (propagate_pure_const): Likewise. * ipa-utils.c (dump_cgraph_node_set): Likewise. * lto-cgraph.c (input_node): Explicitly specify we dump uid. * lto-symtab.c (lto_cgraph_replace_node): Print symbol order instead of node uids. * tree-pretty-print.c (dump_function_header): Likewise. * tree-sra.c (convert_callers_for_node): Dump in traditional format. Print symbol order instead of node uids. lto/ * lto-partition.c (lto_balanced_map): Print symbol order instead of node uids. From-SVN: r198925
2013-05-15 12:35:59 +02:00
fprintf (f, " function %s/%i parameter descriptors:\n",
node->name (), node->order);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
int c;
fprintf (f, " ");
ipa_dump_param (f, info, i);
if (ipa_is_param_used (info, i))
fprintf (f, " used");
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
c = ipa_get_controlled_uses (info, i);
if (c == IPA_UNDESCRIBED_USE)
fprintf (f, " undescribed_use");
else
fprintf (f, " controlled_uses=%i", c);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
fprintf (f, "\n");
}
}
ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg instead of setting number of formal... 2008-04-30 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg instead of setting number of formal parameters to zero. (ipcp_init_stage): Do not set the number of actual parameters to zero either. (ipcp_propagate_stage): Explicitly skipping all calls to nodes which are called with variable number of arguments. (ipcp_insert_stage): Explicitely skipping all nodes which are called with variable number of arguments. (ipcp_callsite_param_print): Skipps callsites to nodes with varaible number of parameters. * ipa-prop.h (struct ipa_node_params): Added flag called_with_var_arguments (ipa_set_param_count): Added. Changed sole setter to use it. (ipa_get_param_count): Added. All readers of param_count converted to use it instead. (ipa_set_called_with_variable_arg): Added. (ipa_is_called_with_var_arguments): Added. (ipa_get_ith_param): Added. All readers of param_decls converted to use it instead. (ipa_set_cs_argument_count): Added, sole writer to argument_count changed to use it. (ipa_get_cs_argument_count): Added, all readers of argument_count changed to cal it. (ipa_get_ith_jump_func): Added. Accessors of jump values changed to use it. * ipa-prop.h (struct ipcp_formal): Renamed to ipcp_lattice (struct ipcp_lattice): Renamed cval_type to type (struct ipa_node_params): ipcp_cval renamed to ipcp_lattices * ipa-cp.c (ipcp_cval_get_cvalue): Changed return value to tree (ipcp_cval_set_cvalue): Changed type of parameter value to tree (ipcp_insert_stage): Changed the type of variable cvalue to tree (ipcp_replace_map_create): Changed the type of parameter cvalue to tree (build_const_val): Changed the type of parameter cvalue to tree (ipcp_propagate_const): Changed the type of parameter cvalue to tree (ipcp_method_cval_set_cvalue_type): Renamed parameter cval_type1 to type * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called constant * ipa-prop.c (ipa_methodlist_init): Renamed to ipa_init_func_list (ipa_methodlist_not_empty): Removed, the sole user now checks directly (ipa_add_method): Renamed to ipa_push_func_to_list (ipa_remove_method): Renamed to ipa_pop_func_from_list (ipa_callsite_param_count): Removed. (ipa_callsite_param_count_set): Removed. (ipa_callsite_param): Removed. (ipa_callsite_callee): Removed. (ipa_callsite_compute_param): Renamed to ipa_compute_jump_functions (ipa_callsite_compute_count): Renamed to ipa_count_arguments (ipa_method_formal_count): Removed. (ipa_method_formal_count_set): Removed. (ipa_method_get_tree): Removed. (ipa_method_tree_map_create): Removed. (ipa_method_compute_tree_map): Renamed to ipa_create_param_decls_array (ipa_create_param_decls_array): Creates the array itself (ipa_create_param_decls_array): Temporary variable info instead of a few dereferences. (ipa_method_formal_compute_count): Renamed to ipa_count_formal_params (ipa_method_compute_modify): Renamed to ipa_detect_param_modifications (get_type): Removed. (ipa_jf_get_info_type): Removed. (ipa_node_create): Renamed to ipa_create_node_params (ipa_free): Renamed to ipa_free_all_node_params (ipa_nodes_create): Renamed to ipa_create_all_node_params (ipa_edges_create): Renamed to ipa_create_all_edge_args (ipa_edges_free): Renamed to ipa_free_all_edge_args (ipa_nodes_free): Integrated into ipa_free_all_node_params and removed (ipa_free_all_node_params): Deallocation to jump_functions moved to ipa_free_all_edge_args (ipa_method_tree_print): Renamed to ipa_print_all_tree_maps (ipa_method_modify_print): Renamed to ipa_print_all_params_modified (ipa_create_methodlist_node): Removed. (ipa_methodlist_method): Removed. (ipa_methodlist_method_set): Removed. (ipa_methodlist_next_method): Removed. (ipa_methodlist_next_method_set): Removed. (ipa_method_is_modified): Removed. (ipa_method_modify_create): Removed. (ipa_method_modify_init): Temporary variable info instead of a few dereferences. (ipa_detect_param_modifications): Temporary variable info instead of a few dereferences. (ipa_compute_jump_functions): Temporary variable info instead of a few dereferences. (ipa_method_modify_set): Removed. (ipa_method_tree_map): Renamed to ipa_get_param_decl_index (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather than craph_node as the first parameter. (ipa_method_modify_stmt): Renamed to ipa_check_stmt_modifications (ipa_method_modify_init): Removed. (ipa_compute_jump_functions): Added a temp variable instead of repeatadly dereferencing the cgraph_edge.aux pointer (ipa_callsite_param_set_type): Removed. (ipa_compute_jump_functions): i renamed to index and moved to an inner block (ipa_callsite_param_set_info_type_formal): Removed. (ipa_callsite_param_set_info_type): Removed. (ipa_callsite_param_map_create): Removed. (ipa_callsite_tree): Removed. (ipa_callsite_caller): Removed. (ipa_pop_func_from_list): return_method removed to return_func * ipa-prop.h (enum cvalue_type): Renamed to ipa_lattice_type, prefixed all values with IPA_. Changed all users. (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN, CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF and FORMAL_IPATYPE IPA_PASS_THROUGH. (union parameter_info): Renamed to jump_func_value. (union jump_func_value): Renamed value to constant (struct ipa_jump_func): Renamed info_type to value (struct ipa_node): Renamed to ipa_node_params (struct ipa_node_params): Renamed ipa_arg_num to param_count (struct ipa_node_params): Renamed ipa_param_tree to param_decls (struct ipa_node_params): Renamed ipa_mod to modified_flags (struct ipa_edge): Renamed to ipa_edge_args (struct ipa_edge_args): Renamed ipa_param_num to argument_count (struct ipa_edge_args): Renamed ipa_param_map to jump_functions (struct ipa_methodlist): Renamed to ipa_func_list (struct ipa_func_list): method_p renamed to node, next_method renamed to next (ipa_methodlist_p): Removed, switched all users to struct pointer (IS_VALID_TREE_MAP_INDEX): Renamed to IS_VALID_JUMP_FUNC_INDEX From-SVN: r134818
2008-04-30 12:01:59 +02:00
cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.h (cgraph_maybe_hot_edge_p): Declare. * ipa-cp.c (n_cloning_candidates): New static variable. (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare. (ipcp_print_all_lattices): Improve debug output. (ipcp_cloning_candidate_p): New function. (ipcp_initialize_node_lattices): Use it. (ipcp_init_stage): Do only analyzis here; prettier debug output. (ipcp_propagate_stage): Prettier debug output. (ipcp_iterate_stage): Initialize latices here; prettier debug output. (ipcp_print_all_structures): Remove. (ipcp_need_redirect_p): Test !n_cloning_candidates. (ipcp_insert_stage): Prettier debug output; call cgraph_remove_unreachable_nodes before propagating. (pass_ipa_cp): Schedule function removal pass. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better debug output. (cgraph_maybe_hot_edge_p): Move to ... * predict.c (cgraph_maybe_hot_edge_p) ... here. * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New. (common_handle_option): Set them; enable ipa-cp when profiling. * ipa-prop.c (ipa_print_node_jump_functions): Prettier output. (ipa_print_all_jump_functions): Likewise. (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags, ipa_print_all_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. From-SVN: r139772
2008-08-29 18:41:35 +02:00
/* Print ipa_tree_map data structures of all functions in the
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
callgraph to F. */
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
void
cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.h (cgraph_maybe_hot_edge_p): Declare. * ipa-cp.c (n_cloning_candidates): New static variable. (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare. (ipcp_print_all_lattices): Improve debug output. (ipcp_cloning_candidate_p): New function. (ipcp_initialize_node_lattices): Use it. (ipcp_init_stage): Do only analyzis here; prettier debug output. (ipcp_propagate_stage): Prettier debug output. (ipcp_iterate_stage): Initialize latices here; prettier debug output. (ipcp_print_all_structures): Remove. (ipcp_need_redirect_p): Test !n_cloning_candidates. (ipcp_insert_stage): Prettier debug output; call cgraph_remove_unreachable_nodes before propagating. (pass_ipa_cp): Schedule function removal pass. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better debug output. (cgraph_maybe_hot_edge_p): Move to ... * predict.c (cgraph_maybe_hot_edge_p) ... here. * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New. (common_handle_option): Set them; enable ipa-cp when profiling. * ipa-prop.c (ipa_print_node_jump_functions): Prettier output. (ipa_print_all_jump_functions): Likewise. (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags, ipa_print_all_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. From-SVN: r139772
2008-08-29 18:41:35 +02:00
ipa_print_all_params (FILE * f)
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
{
struct cgraph_node *node;
cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.h (cgraph_maybe_hot_edge_p): Declare. * ipa-cp.c (n_cloning_candidates): New static variable. (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare. (ipcp_print_all_lattices): Improve debug output. (ipcp_cloning_candidate_p): New function. (ipcp_initialize_node_lattices): Use it. (ipcp_init_stage): Do only analyzis here; prettier debug output. (ipcp_propagate_stage): Prettier debug output. (ipcp_iterate_stage): Initialize latices here; prettier debug output. (ipcp_print_all_structures): Remove. (ipcp_need_redirect_p): Test !n_cloning_candidates. (ipcp_insert_stage): Prettier debug output; call cgraph_remove_unreachable_nodes before propagating. (pass_ipa_cp): Schedule function removal pass. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better debug output. (cgraph_maybe_hot_edge_p): Move to ... * predict.c (cgraph_maybe_hot_edge_p) ... here. * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New. (common_handle_option): Set them; enable ipa-cp when profiling. * ipa-prop.c (ipa_print_node_jump_functions): Prettier output. (ipa_print_all_jump_functions): Likewise. (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags, ipa_print_all_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. From-SVN: r139772
2008-08-29 18:41:35 +02:00
fprintf (f, "\nFunction parameters:\n");
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.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.c (cgraph_remove_node): Do not remove nested nodes. * cgraph.h (cgraph_maybe_hot_edge_p): Declare. * ipa-cp.c (n_cloning_candidates): New static variable. (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare. (ipcp_print_all_lattices): Improve debug output. (ipcp_cloning_candidate_p): New function. (ipcp_initialize_node_lattices): Use it. (ipcp_init_stage): Do only analyzis here; prettier debug output. (ipcp_propagate_stage): Prettier debug output. (ipcp_iterate_stage): Initialize latices here; prettier debug output. (ipcp_print_all_structures): Remove. (ipcp_need_redirect_p): Test !n_cloning_candidates. (ipcp_insert_stage): Prettier debug output; call cgraph_remove_unreachable_nodes before propagating. (pass_ipa_cp): Schedule function removal pass. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better debug output. (cgraph_maybe_hot_edge_p): Move to ... * predict.c (cgraph_maybe_hot_edge_p) ... here. * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New. (common_handle_option): Set them; enable ipa-cp when profiling. * ipa-prop.c (ipa_print_node_jump_functions): Prettier output. (ipa_print_all_jump_functions): Likewise. (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags, ipa_print_all_param_flags): Remove. (ipa_print_node_params, ipa_print_all_params): New. From-SVN: r139772
2008-08-29 18:41:35 +02:00
ipa_print_node_params (f, node);
ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. 2008-07-23 Martin Jambor <mjambor@suse.cz> * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed rather than for DECL_SAVED_TREE. * ipa-prop.c: Include diagnostic.h. (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs thoroughly. (ipa_detect_param_modifications): Function rewritten from scratch. (ipa_compute_jump_functions): Changed accesses to modification flags. (ipa_free_node_params_substructures): Update flags destruction. (ipa_node_duplication_hook): Update flags duplication. (ipa_print_all_params_modified): Updated flag access. * ipa-prop.h (struct ipa_param_flags): New structure. (struct ipa_node_params): New field modification_analysis_done, modified_flags changed into param_flags. (ipa_is_ith_param_modified): Changed to use new flags. * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies. * ipa-prop.c (ipa_print_all_jump_functions): Moved here from ipa-cp.c and split into two functions. (ipa_print_node_jump_functions): New function. (compute_scalar_jump_functions): New function. (type_like_member_ptr_p): New function. (compute_pass_through_member_ptrs): New function. (fill_member_ptr_cst_jump_function): New function. (determine_cst_member_ptr): New function. (compute_cst_member_ptr_arguments): New function. (ipa_compute_jump_functions): Complete rewrite. * ipa-prop.h (enum jump_func_type): Make explicit that we depend on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR. (struct ipa_member_ptr_cst): New structure. (union jump_func_value): New field member_cst. * ipa-cp.c (ipcp_lat_is_insertable): New function. (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled jump function types. (ipcp_print_all_lattices): Slight fprintf rearrangement. (ipcp_print_all_structures): Call ipa_print_all_jump_functions instead of ipcp_print_all_jump_functions. (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps only for replacable scalars. * doc/invoke.texi (Optimize options): Add description of -findirect-inlining. * common.opt (flag_indirect_inlining): New flag. * opts.c (decode_options): Set flag_indirect_inlining when optimize >= 3. * ipa-inline.c: Include ipa-prop.h. (inline_indirect_intraprocedural_analysis): New function. (inline_generate_summary): Allocate parameter and argument info structures, call inline_indirect_intraprocedural_analysis on each node when doing indirect inlining and deallocate indirect inlining data structures in the end. * ipa-prop.c (ipa_create_param_decls_array): Return if already done. (free_all_ipa_structures_after_iinln): New function. (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be done. * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies. * cgraphbuild.c (compute_call_stmt_bb_frequency): New function. (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead of computing the frequency separately. * ipa-cp.c (ipcp_print_all_structures): Replace a call to ipa_print_all_param_modified with a call to ipa_print_all_param_flags. * ipa-prop.c (ipa_get_member_ptr_load_param): New function. (ipa_get_stmt_member_ptr_load_param): New function. (ipa_is_ssa_with_stmt_def): New function. (ipa_note_param_call): New function. (ipa_analyze_call_uses): New function. (ipa_analyze_stmt_uses): New function. (ipa_analyze_params_uses): New function. (ipa_free_node_params_substructures): Also free the param_calls linked list. (ipa_node_duplication_hook): Also duplicate the param_calls linked list. (ipa_print_node_param_flags): New function. (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags. (ipa_print_all_param_flags): Calls ipa_print_node_param_flags. * ipa-prop.h (struct ipa_param_flags): New field called. (struct ipa_param_call_note): New structure. (struct ipa_node_params): New fields param_calls and uses_analysis_done. (ipa_is_ith_param_called): New function. * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call ipa_analyze_params_uses and dump parameter flags. * ipa-inline.c (cgraph_decide_recursive_inlining): Call ipa_propagate_indirect_call_infos if performing indirect inlining, pass a new parameter new_edges to it. (add_new_edges_to_heap): New fucntion. (cgraph_decide_inlining_of_small_functions): New vector new_indirect_edges for newly found indirect edges , call ipa_propagate_indirect_call_infos after inlining. (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after inlining if performing indirect inlining. Call free_all_ipa_structures_after_iinln when doing so too. (inline_generate_summary): Do not call free_all_ipa_structures_after_iinln here. * ipa-prop.c (update_jump_functions_after_inlining): New function. (print_edge_addition_message): New function. (update_call_notes_after_inlining): New function. (propagate_info_to_inlined_callees): New function. (ipa_propagate_indirect_call_infos): New function. * ipa-prop.h: Include cgraph.h (struct ipa_param_call_note): Fields reordered, new field processed. * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new flag indirect_call. * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have rediscovered call statements. * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero. (dump_cgraph_node): Dump also the indirect_call flag. (cgraph_clone_edge): Copy also the indirect_call flag. * tree-inline.c (copy_bb): Do not check for fndecls from call expressions, check for edge availability when moving clones. (get_indirect_callee_fndecl): New function. (expand_call_inline): If callee declaration is not apprent from the statement, try calling get_indirect_callee_fndecl. Do not issue warnings or call sorry when not inlinings an indirect edge. * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies. * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a bit more frandly to matching. * testsuite/g++.dg/ipa/iinline-1.C: New testcase. * testsuite/gcc.dg/ipa/iinline-1.c: New testcase. * testsuite/gcc.dg/ipa/modif-1.c: New testcase. From-SVN: r138092
2008-07-23 21:45:45 +02:00
}
/* Return a heap allocated vector containing formal parameters of FNDECL. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree>
ipa_get_vector_of_formal_parms (tree fndecl)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> args;
int count;
tree parm;
gcc_assert (!flag_wpa);
ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. 2011-07-18 Martin Jambor <mjambor@suse.cz> * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. (ipcp_values_pool): Declare. (ipcp_sources_pool): Likewise. (ipcp_lattice): Changed to forward declaration. (ipa_param_descriptor): Removed fields ipcp_lattice, types and cannot_devirtualize. (ipa_node_params): New fields descriptors, lattices, known_vals, clone_for_all_contexts and node dead, removed fields params and count_scale. (ipa_set_param_count): Removed. (ipa_get_param_count): Made to work with descriptors vector. (ipa_get_param): Updated. (ipa_param_cannot_devirtualize_p): Removed. (ipa_param_types_vec_empty): Likewise. (ipa_set_param_used): New function. (ipa_get_param_used): Updated to use descriptors vector. (ipa_func_list): Removed. (ipa_init_func_list): Removed declaration. (ipa_push_func_to_list_1): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_push_func_to_list): Removed. (ipa_lattice_from_jfunc): Remove declaration. (ipa_get_jf_pass_through_result): Declare. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_get_lattice): Update. (ipa_lat_is_single_const): New function. * ipa-prop.c (ipa_push_func_to_list_1): Removed. (ipa_init_func_list): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_get_param_decl_index): Fix coding style. (count_formal_params): Removed. (count_formal_params_1): Renamed to count_formal_params. (ipa_populate_param_decls): Update to use descriptors vector. (ipa_initialize_node_params): Likewise. (visit_ref_for_mod_analysis): Use ipa_set_param_used. (ipa_analyze_params_uses): Likewise. (ipa_free_node_params_substructures): Likewise and free also lattices and known values. (duplicate_array): Removed. (ipa_edge_duplication_hook): Add the new edge to the list of edge clones. (ipa_node_duplication_hook): Update to use new lattices. (ipa_free_all_structures_after_ipa_cp): Free alloc pools. (ipa_free_all_structures_after_iinln): Likewise. (ipa_write_node_info): Update to use new lattices. (ipa_read_node_info): Likewise. (ipa_get_jf_pass_through_result): New function. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc. * ipa-cp.c: Reimplemented. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed. (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter. (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise. * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies. * doc/invoke.texi (devirt-type-list-size): Removed description. (ipa-cp-value-list-size): Added description. * testsuite/gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-2.c: Likewise. * testsuite/gcc.dg/ipa/ipa-3.c: Likewise and made functions static. * testsuite/gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-5.c: Likewise. * testsuite/gcc.dg/ipa/ipa-7.c: Likewise. * testsuite/gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipacost-1.c: Likewise. * testsuite/gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some functions. * testsuite/gcc.dg/ipa/ipcp-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-2.c: Likewise. * testsuite/gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. From-SVN: r176424
2011-07-19 00:03:39 +02:00
count = count_formal_params (fndecl);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
args.create (count);
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
for (parm = DECL_ARGUMENTS (fndecl); parm; parm = DECL_CHAIN (parm))
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
args.quick_push (parm);
return args;
}
/* Return a heap allocated vector containing types of formal parameters of
function type FNTYPE. */
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
vec<tree>
ipa_get_vector_of_formal_parm_types (tree fntype)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> types;
int count = 0;
tree t;
for (t = TYPE_ARG_TYPES (fntype); t; t = TREE_CHAIN (t))
count++;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
types.create (count);
for (t = TYPE_ARG_TYPES (fntype); t; t = TREE_CHAIN (t))
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
types.quick_push (TREE_VALUE (t));
return types;
}
/* Modify the function declaration FNDECL and its type according to the plan in
ADJUSTMENTS. It also sets base fields of individual adjustments structures
to reflect the actual parameters being modified which are determined by the
base_index field. */
void
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec adjustments)
{
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
vec<tree> oparms = ipa_get_vector_of_formal_parms (fndecl);
tree orig_type = TREE_TYPE (fndecl);
tree old_arg_types = TYPE_ARG_TYPES (orig_type);
/* The following test is an ugly hack, some functions simply don't have any
arguments in their type. This is probably a bug but well... */
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
bool care_for_types = (old_arg_types != NULL_TREE);
bool last_parm_void;
vec<tree> otypes;
if (care_for_types)
{
last_parm_void = (TREE_VALUE (tree_last (old_arg_types))
== void_type_node);
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
otypes = ipa_get_vector_of_formal_parm_types (orig_type);
if (last_parm_void)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
gcc_assert (oparms.length () + 1 == otypes.length ());
else
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
gcc_assert (oparms.length () == otypes.length ());
}
else
{
last_parm_void = false;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
otypes.create (0);
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
int len = adjustments.length ();
tree *link = &DECL_ARGUMENTS (fndecl);
tree new_arg_types = NULL;
for (int i = 0; i < len; i++)
{
struct ipa_parm_adjustment *adj;
gcc_assert (link);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adj = &adjustments[i];
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
tree parm;
if (adj->op == IPA_PARM_OP_NEW)
parm = NULL;
else
parm = oparms[adj->base_index];
adj->base = parm;
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (adj->op == IPA_PARM_OP_COPY)
{
if (care_for_types)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
new_arg_types = tree_cons (NULL_TREE, otypes[adj->base_index],
new_arg_types);
*link = parm;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
link = &DECL_CHAIN (parm);
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
else if (adj->op != IPA_PARM_OP_REMOVE)
{
tree new_parm;
tree ptype;
if (adj->by_ref)
ptype = build_pointer_type (adj->type);
else
{
ptype = adj->type;
if (is_gimple_reg_type (ptype)
&& TYPE_MODE (ptype) != BLKmode)
{
unsigned malign = GET_MODE_ALIGNMENT (TYPE_MODE (ptype));
if (TYPE_ALIGN (ptype) != malign)
ptype = build_aligned_type (ptype, malign);
}
}
if (care_for_types)
new_arg_types = tree_cons (NULL_TREE, ptype, new_arg_types);
new_parm = build_decl (UNKNOWN_LOCATION, PARM_DECL, NULL_TREE,
ptype);
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
const char *prefix = adj->arg_prefix ? adj->arg_prefix : "SYNTH";
DECL_NAME (new_parm) = create_tmp_var_name (prefix);
DECL_ARTIFICIAL (new_parm) = 1;
DECL_ARG_TYPE (new_parm) = ptype;
DECL_CONTEXT (new_parm) = fndecl;
TREE_USED (new_parm) = 1;
DECL_IGNORED_P (new_parm) = 1;
layout_decl (new_parm, 0);
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (adj->op == IPA_PARM_OP_NEW)
adj->base = NULL;
else
adj->base = parm;
adj->new_decl = new_parm;
*link = new_parm;
tree.h (DECL_CHAIN): Define. gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223
2010-07-15 16:31:28 +02:00
link = &DECL_CHAIN (new_parm);
}
}
*link = NULL_TREE;
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
tree new_reversed = NULL;
if (care_for_types)
{
new_reversed = nreverse (new_arg_types);
if (last_parm_void)
{
if (new_reversed)
TREE_CHAIN (new_arg_types) = void_list_node;
else
new_reversed = void_list_node;
}
}
/* Use copy_node to preserve as much as possible from original type
(debug info, attribute lists etc.)
Exception is METHOD_TYPEs must have THIS argument.
When we are asked to remove it, we need to build new FUNCTION_TYPE
instead. */
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
tree new_type = NULL;
if (TREE_CODE (orig_type) != METHOD_TYPE
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
|| (adjustments[0].op == IPA_PARM_OP_COPY
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
&& adjustments[0].base_index == 0))
{
new_type = build_distinct_type_copy (orig_type);
TYPE_ARG_TYPES (new_type) = new_reversed;
}
else
{
new_type
= build_distinct_type_copy (build_function_type (TREE_TYPE (orig_type),
new_reversed));
TYPE_CONTEXT (new_type) = TYPE_CONTEXT (orig_type);
DECL_VINDEX (fndecl) = NULL_TREE;
}
/* When signature changes, we need to clear builtin info. */
if (DECL_BUILT_IN (fndecl))
{
DECL_BUILT_IN_CLASS (fndecl) = NOT_BUILT_IN;
DECL_FUNCTION_CODE (fndecl) = (enum built_in_function) 0;
}
TREE_TYPE (fndecl) = new_type;
DECL_VIRTUAL_P (fndecl) = 0;
DECL_LANG_SPECIFIC (fndecl) = NULL;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
otypes.release ();
oparms.release ();
}
/* Modify actual arguments of a function call CS as indicated in ADJUSTMENTS.
If this is a directly recursive call, CS must be NULL. Otherwise it must
contain the corresponding call graph edge. */
void
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
ipa_modify_call_arguments (struct cgraph_edge *cs, gcall *stmt,
ipa_parm_adjustment_vec adjustments)
{
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
struct cgraph_node *current_node = cgraph_node::get (current_function_decl);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> vargs;
vec<tree, va_gc> **debug_args = NULL;
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gcall *new_stmt;
gimple_stmt_iterator gsi, prev_gsi;
tree callee_decl;
int i, len;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
len = adjustments.length ();
vargs.create (len);
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
callee_decl = !cs ? gimple_call_fndecl (stmt) : cs->callee->decl;
IPA REF refactoring * Makefile.in: Removed header file (ipa-ref-inline.h). * cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function called. (cgraph_speculative_call_info): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_for_node_and_aliases): Likewise. (verify_cgraph_node): Likewise. * cgraph.h: Batch of IPA REF functions become member functions of symtab_node: add_reference, maybe_add_reference, clone_references, clone_referring, clone_reference, find_reference, remove_stmt_references, remove_all_references, remove_all_referring, dump_references, dump_referring, has_alias_p, iterate_reference, iterate_referring. * cgraphbuild.c (record_reference): New IPA REF function used. (record_type_list): Likewise. (record_eh_tables): Likewise. (mark_address): Likewise. (mark_load): Likewise. (mark_store): Likewise. (pass_build_cgraph_edges): Likewise. (rebuild_cgraph_edge): Likewise. (cgraph_rebuild_references): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * cgraphclones.c (cgraph_clone_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_materialize_all_clones): Likewise. * cgraphunit.c (cgraph_reset_node): Likewise. (cgraph_reset_node): Likewise. (analyze_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_function): Likewise. * ipa-comdats.c (propagate_comdat_group): Likewise. (enqueue_references): Likewise. * ipa-cp.c (ipcp_discover_new_direct_edges): Likewise. (create_specialized_node): Likewise. * ipa-devirt.c (referenced_from_vtable_p): Likewise. * ipa-inline-transform.c (can_remove_node_now_p_1): Likewise. * ipa-inline.c (reset_edge_caches): Likewise. (update_caller_keys): Likewise. (execute): Likewise. * ipa-prop.c (remove_described_reference): Likewise. (propagate_controlled_uses): Likewise. (ipa_edge_duplication_hook): Likewise. (ipa_modify_call_arguments): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. * ipa-ref-inline.h: Header file removed, functions moved to symtab_node class. * ipa-ref.c (remove_reference): New class member function. (cannot_lead_to_return): New class member function. (referring_ref_list): Likewise. (referred_ref_list): Likewise. Rest of functions moved to symtab_node class. * ipa-ref.h: New member functions remove_reference, cannot_lead_to_return, referring_ref_list, referred_ref_list added to ipa_ref class. ipa_ref_list class has new member functions: first_reference, first_referring, clear, nreferences. * ipa-reference.c (analyze_function): New IPA REF function used. (write_node_summary_p): Likewise. (ipa_reference_write_optimization_summary): Likewise. * ipa-split.c (split_function): Likewise. * ipa-utils.c (ipa_reverse_postorder): Likewise. * ipa-visibility.c (cgraph_non_local_node_p_1): Likewise. (function_and_variable_visibility): Likewise. * ipa.c (has_addr_references_p): Likewise. (process_references): Argument type changed. (symtab_remove_unreachable_nodes): New IPA REF function used. (process_references): Likewise. (set_writeonly_bit): Likewise. * lto-cgraph.c: Implementation of new symtab_node member functions that uses new IPA REF functions. * lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used. * lto-streamer-out.c (output_symbol_p): Likewise. * lto-streamer.h (referenced_from_this_partition_p): Argument type changed. * lto/lto-partition.c (add_references_to_partition): New IPA REF function used. (add_symbol_to_partition_1): Likewise. (lto_balanced_map): Likewise. * lto/lto-symtab.c (lto_cgraph_replace_node): Likewise. * symtab.c: Implementation of new IPA REF API. * trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used. (ipa_tm_create_version): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (gen_emutls_addr): Likewise. * tree-inline.c (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * varpool.c (varpool_remove_unreferenced_decls): Likewise. (varpool_for_node_and_aliases): Likewise. From-SVN: r211987
2014-06-25 18:55:46 +02:00
current_node->remove_stmt_references (stmt);
gsi = gsi_for_stmt (stmt);
prev_gsi = gsi;
gsi_prev (&prev_gsi);
for (i = 0; i < len; i++)
{
struct ipa_parm_adjustment *adj;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adj = &adjustments[i];
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (adj->op == IPA_PARM_OP_COPY)
{
tree arg = gimple_call_arg (stmt, adj->base_index);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (arg);
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
else if (adj->op != IPA_PARM_OP_REMOVE)
{
tree expr, base, off;
location_t loc;
unsigned int deref_align = 0;
bool deref_base = false;
/* We create a new parameter out of the value of the old one, we can
do the following kind of transformations:
- A scalar passed by reference is converted to a scalar passed by
value. (adj->by_ref is false and the type of the original
actual argument is a pointer to a scalar).
- A part of an aggregate is passed instead of the whole aggregate.
The part can be passed either by value or by reference, this is
determined by value of adj->by_ref. Moreover, the code below
handles both situations when the original aggregate is passed by
value (its type is not a pointer) and when it is passed by
reference (it is a pointer to an aggregate).
When the new argument is passed by reference (adj->by_ref is true)
it must be a part of an aggregate and therefore we form it by
simply taking the address of a reference inside the original
aggregate. */
gcc_checking_assert (adj->offset % BITS_PER_UNIT == 0);
base = gimple_call_arg (stmt, adj->base_index);
loc = DECL_P (base) ? DECL_SOURCE_LOCATION (base)
: EXPR_LOCATION (base);
if (TREE_CODE (base) != ADDR_EXPR
&& POINTER_TYPE_P (TREE_TYPE (base)))
off = build_int_cst (adj->alias_ptr_type,
adj->offset / BITS_PER_UNIT);
else
{
HOST_WIDE_INT base_offset;
tree prev_base;
bool addrof;
if (TREE_CODE (base) == ADDR_EXPR)
{
base = TREE_OPERAND (base, 0);
addrof = true;
}
else
addrof = false;
prev_base = base;
base = get_addr_base_and_unit_offset (base, &base_offset);
/* Aggregate arguments can have non-invariant addresses. */
if (!base)
{
base = build_fold_addr_expr (prev_base);
off = build_int_cst (adj->alias_ptr_type,
adj->offset / BITS_PER_UNIT);
}
else if (TREE_CODE (base) == MEM_REF)
{
if (!addrof)
{
deref_base = true;
deref_align = TYPE_ALIGN (TREE_TYPE (base));
}
off = build_int_cst (adj->alias_ptr_type,
base_offset
+ adj->offset / BITS_PER_UNIT);
off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1),
tree.h (int_const_binop): Remove notrunc argument. 2011-05-04 Richard Guenther <rguenther@suse.de> * tree.h (int_const_binop): Remove notrunc argument. * fold-const.c (int_const_binop): Remove notrunc argument. Always create integer constants that are properly truncated. (extract_muldiv_1): Expand one notrunc int_const_binop caller. (const_binop): Remove zero notrunc argument to int_const_binop. (size_binop_loc): Likewise. (fold_div_compare): Likewise. (maybe_canonicalize_comparison_1): Likewise. (fold_comparison): Likewise. (fold_binary_loc): Likewise. (multiple_of_p): Likewise. * expr.c (store_constructor): Likewise. * gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise. (maybe_fold_stmt_addition): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * stor-layout.c (layout_type): Likewise. * tree-data-ref.c (tree_fold_divides_p): Likewise. * tree-sra.c (build_ref_for_offset): Likewise. (build_user_friendly_ref_for_offset): Likewise. * tree-ssa-address.c (maybe_fold_tmr): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise. * tree-ssa-loop-niter.c (inverse): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa.c (maybe_rewrite_mem_ref_base): Likewise. * tree-switch-conversion.c (check_range): Likewise. (build_constructors): Likewise. * tree-vect-generic.c (expand_vector_piecewise): Likewise. * tree-vrp.c (set_and_canonicalize_value_range): Likewise. (extract_range_from_assert): Likewise. (vrp_int_const_binop): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. (check_array_ref): Likewise. (find_case_label_range): Likewise. (simplify_div_or_mod_using_ranges): Likewise. * tree-cfg.c (group_case_labels_stmt): Use double-ints for comparing case labels for merging. ada/ * gcc-interface/trans.c (gnat_to_gnu): Remove zero notrunc argument to int_const_binop. (pos_to_constructor): Likewise. fortran/ * trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc argument to int_const_binop. From-SVN: r173356
2011-05-04 11:04:53 +02:00
off);
base = TREE_OPERAND (base, 0);
}
else
{
off = build_int_cst (adj->alias_ptr_type,
base_offset
+ adj->offset / BITS_PER_UNIT);
base = build_fold_addr_expr (base);
}
}
if (!adj->by_ref)
{
tree type = adj->type;
unsigned int align;
unsigned HOST_WIDE_INT misalign;
builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte... 2012-05-03 Martin Jambor <mjambor@suse.cz> * builtins.c (get_object_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_pointer_alignment_1 for dereference alignment. (get_pointer_alignment_1): Return whether we can determine the alignment or conservatively assume byte alignment. Return the alignment by reference. Use get_ptr_info_alignment to get SSA name alignment. (get_object_alignment): Update call to get_object_alignment_1. (get_object_or_type_alignment): Likewise, fall back to type alignment only when it returned false. (get_pointer_alignment): Update call to get_pointer_alignment_1. * fold-const.c (get_pointer_modulus_and_residue): Update call to get_object_alignment_1. * ipa-prop.c (ipa_modify_call_arguments): Update call to get_pointer_alignment_1. * tree-sra.c (build_ref_for_offset): Likewise, fall back to the type of MEM_REF or TARGET_MEM_REF only when it returns false. * tree-ssa-ccp.c (get_value_from_alignment): Update call to get_object_alignment_1. (ccp_finalize): Use set_ptr_info_alignment. * tree.h (get_object_alignment_1): Update declaration. (get_pointer_alignment_1): Likewise. * gimple-pretty-print.c (dump_gimple_phi): Use get_ptr_info_alignment. (dump_gimple_stmt): Likewise. * tree-flow.h (ptr_info_def): Updated comments of fields align and misalign. (get_ptr_info_alignment): Declared. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. * tree-ssa-address.c (copy_ref_info): Use new access functions to get and set alignment of SSA names. * tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Call mark_ptr_info_alignment_unknown. * tree-ssanames.c (get_ptr_info_alignment): New function. (mark_ptr_info_alignment_unknown): Likewise. (set_ptr_info_alignment): Likewise. (adjust_ptr_info_misalignment): Likewise. (get_ptr_info): Call mark_ptr_info_alignment_unknown. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Likewise. (bump_vector_ptr): Likewise. * tree-vect-stmts.c (create_array_ref): Use set_ptr_info_alignment. (vectorizable_store): Likewise. (vectorizable_load): Likewise. From-SVN: r187101
2012-05-03 17:48:56 +02:00
if (deref_base)
{
align = deref_align;
misalign = 0;
}
else
{
get_pointer_alignment_1 (base, &align, &misalign);
if (TYPE_ALIGN (type) > align)
align = TYPE_ALIGN (type);
}
2014-05-06 18:25:05 +02:00
misalign += (offset_int::from (off, SIGNED).to_short_addr ()
* BITS_PER_UNIT);
misalign = misalign & (align - 1);
if (misalign != 0)
Add inline functions for various bitwise operations. * hwint.h (least_bit_hwi, pow2_or_zerop, pow2p_hwi, ctz_or_zero): New. * hwint.c (exact_log2): Use pow2p_hwi. (ctz_hwi, ffs_hwi): Use least_bit_hwi. * alias.c (memrefs_conflict_p): Use pow2_or_zerop. * builtins.c (get_object_alignment_2, get_object_alignment) (get_pointer_alignment, fold_builtin_atomic_always_lock_free): Use least_bit_hwi. * calls.c (compute_argument_addresses, store_one_arg): Use least_bit_hwi. * cfgexpand.c (expand_one_stack_var_at): Use least_bit_hwi. * combine.c (force_to_mode): Use least_bit_hwi. * emit-rtl.c (set_mem_attributes_minus_bitpos, adjust_address_1): Use least_bit_hwi. * expmed.c (synth_mult, expand_divmod): Use ctz_or_zero, ctz_hwi. (init_expmed_one_conv): Use pow2p_hwi. * fold-const.c (round_up_loc, round_down_loc): Use pow2_or_zerop. (fold_binary_loc): Use pow2p_hwi. * function.c (assign_parm_find_stack_rtl): Use least_bit_hwi. * gimple-fold.c (gimple_fold_builtin_memory_op): Use pow2p_hwi. * gimple-ssa-strength-reduction.c (replace_ref): Use least_bit_hwi. * hsa-gen.c (gen_hsa_addr_with_align, hsa_bitmemref_alignment): Use least_bit_hwi. * ipa-cp.c (ipcp_alignment_lattice::meet_with_1): Use least_bit_hwi. * ipa-prop.c (ipa_modify_call_arguments): Use least_bit_hwi. * omp-low.c (oacc_loop_fixed_partitions) (oacc_loop_auto_partitions): Use least_bit_hwi. * rtlanal.c (nonzero_bits1): Use ctz_or_zero. * stor-layout.c (place_field): Use least_bit_hwi. * tree-pretty-print.c (dump_generic_node): Use pow2p_hwi. * tree-sra.c (build_ref_for_offset): Use least_bit_hwi. * tree-ssa-ccp.c (ccp_finalize): Use least_bit_hwi. * tree-ssa-math-opts.c (bswap_replace): Use least_bit_hwi. * tree-ssa-strlen.c (handle_builtin_memcmp): Use pow2p_hwi. * tree-vect-data-refs.c (vect_analyze_group_access_1) (vect_grouped_store_supported, vect_grouped_load_supported) (vect_permute_load_chain, vect_shift_permute_load_chain) (vect_transform_grouped_load): Use pow2p_hwi. * tree-vect-generic.c (expand_vector_divmod): Use ctz_or_zero. * tree-vect-patterns.c (vect_recog_divmod_pattern): Use ctz_or_zero. * tree-vect-stmts.c (vectorizable_mask_load_store): Use least_bit_hwi. * tsan.c (instrument_expr): Use least_bit_hwi. * var-tracking.c (negative_power_of_two_p): Use pow2_or_zerop. From-SVN: r240194
2016-09-16 21:20:44 +02:00
align = least_bit_hwi (misalign);
if (align < TYPE_ALIGN (type))
type = build_aligned_type (type, align);
base = force_gimple_operand_gsi (&gsi, base,
true, NULL, true, GSI_SAME_STMT);
expr = fold_build2_loc (loc, MEM_REF, type, base, off);
REF_REVERSE_STORAGE_ORDER (expr) = adj->reverse;
/* If expr is not a valid gimple call argument emit
a load into a temporary. */
if (is_gimple_reg_type (TREE_TYPE (expr)))
{
gimple *tem = gimple_build_assign (NULL_TREE, expr);
if (gimple_in_ssa_p (cfun))
{
gimple_set_vuse (tem, gimple_vuse (stmt));
expr = make_ssa_name (TREE_TYPE (expr), tem);
}
else
gimple-expr.h (create_tmp_var_raw, [...]): Add default NULL value to last argument. * gimple-expr.h (create_tmp_var_raw, create_tmp_var, create_tmp_reg): Add default NULL value to last argument. * tree-ssanames.h (make_ssa_name, copy_ssa_name): Likewise. * gimple-low.c (lower_builtin_posix_memalign): Remove NULL last argument from create_tmp_var_raw, create_tmp_var, create_tmp_reg, make_ssa_name and copy_ssa_name calls. * tree-ssa-strlen.c (get_string_length): Likewise. * tree-emutls.c (gen_emutls_addr, lower_emutls_1): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_expr, instrument_builtin_call, instrument_func_entry): Likewise. * varpool.c (add_new_static_var): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * gimplify.c (internal_get_tmp_var, gimplify_return_expr, gimplify_modify_expr_to_memcpy, gimplify_modify_expr_to_memset, gimplify_init_ctor_eval_range, gimplify_init_constructor, gimplify_omp_atomic, gimplify_expr): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_peel_loop_to_edge, vect_loop_versioning): Likewise. * tree-if-conv.c (version_loop_for_if_conversion): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern): Likewise. * tree-sra.c (build_ref_for_offset, create_access_replacement): Likewise. * tree-cfg.c (make_blocks): Likewise. * tree-eh.c (lower_eh_constructs_2, lower_resx, lower_eh_dispatch): Likewise. * tree-ssa-propagate.c (update_call_from_tree): Likewise. * tree-complex.c (get_component_ssa_name, expand_complex_div_wide): Likewise. * tree-ssa-math-opts.c (build_and_insert_cast): Likewise. * tree-tailcall.c (update_accumulator_with_ops): Likewise. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm, execute_load_motion, reassociate_to_the_same_stmt): Likewise. * tree-ssa-reassoc.c (build_and_add_sum, optimize_range_tests_to_bit_test, update_ops, maybe_optimize_range_tests, rewrite_expr_tree, linearize_expr, negate_value, repropagate_negates): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-inline.c (remap_ssa_name, setup_one_parameter, declare_return_variable, tree_function_versioning): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * cfgexpand.c (update_alias_info_with_stack_vars, expand_used_vars): Likewise. * tree-ssa-phiopt.c (conditional_replacement, abs_replacement, neg_replacement): Likewise. * gimplify-me.c (force_gimple_operand_1, gimple_regimplify_operands): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * tree-switch-conversion.c (emit_case_bit_tests, build_one_array, build_arrays, gen_def_assigns): Likewise. * gimple-fold.c (gimple_fold_builtin_memory_op, gimple_fold_builtin_strcat, gimple_fold_call, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_encode_value, ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_si_overflow, instrument_bool_enum_load, instrument_nonnull_arg): Likewise. * tree-outof-ssa.c (insert_backedge_copies): Likewise. * tree-ssa-loop-manip.c (create_iv, tree_transform_and_unroll_loop): Likewise. * omp-low.c (scan_omp_parallel, lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_lastprivate_clauses, expand_parallel_call, expand_omp_for_static_chunk, expand_omp_atomic_pipeline, expand_omp_target, maybe_add_implicit_barrier_cancel, lower_omp_single_simple, lower_omp_critical, lower_omp_for, task_copyfn_copy_decl, lower_depend_clauses, lower_omp_target, lower_omp_1, ipa_simd_modify_stmt_ops, simd_clone_adjust): Likewise. * tree-parloops.c (take_address_of, create_phi_for_local_result, create_call_for_reduction_1, separate_decls_in_region, create_parallel_loop): Likewise. * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_dependence, handle_scalar_deps_crossing_scop_limits): Likewise. * trans-mem.c (lower_transaction, build_tm_load, build_tm_store, expand_assign_tm, expand_call_tm, expand_transaction, ipa_tm_insert_gettmclone_call): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_setup_realignment): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_call, vectorizable_simd_clone_call, vectorizable_conversion, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. c/ * c-typeck.c (convert_lvalue_to_rvalue, build_atomic_assign, c_finish_stmt_expr): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * c-array-notation.c (fix_builtin_array_notation_fn, build_array_notation_expr, fix_conditional_array_notations_1, fix_array_notation_expr, fix_array_notation_call_expr): Likewise. cp/ * cp-gimplify.c (cxx_omp_clause_apply_fn): Remove NULL last argument from create_tmp_var calls. c-family/ * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. * cilk.c (gimplify_cilk_spawn): Likewise. * c-omp.c (c_finish_omp_atomic): Likewise. fortran/ * trans-openmp.c (gfc_omp_finish_clause, gfc_trans_omp_array_reduction_or_udr, gfc_trans_omp_atomic): Remove NULL last argument from create_tmp_var_raw and create_tmp_var calls. From-SVN: r218181
2014-11-29 12:35:30 +01:00
expr = create_tmp_reg (TREE_TYPE (expr));
gimple_assign_set_lhs (tem, expr);
gsi_insert_before (&gsi, tem, GSI_SAME_STMT);
}
}
else
{
expr = fold_build2_loc (loc, MEM_REF, adj->type, base, off);
REF_REVERSE_STORAGE_ORDER (expr) = adj->reverse;
expr = build_fold_addr_expr (expr);
expr = force_gimple_operand_gsi (&gsi, expr,
true, NULL, true, GSI_SAME_STMT);
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.quick_push (expr);
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (adj->op != IPA_PARM_OP_COPY && MAY_HAVE_DEBUG_STMTS)
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
{
unsigned int ix;
tree ddecl = NULL_TREE, origin = DECL_ORIGIN (adj->base), arg;
gimple *def_temp;
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
arg = gimple_call_arg (stmt, adj->base_index);
if (!useless_type_conversion_p (TREE_TYPE (origin), TREE_TYPE (arg)))
{
if (!fold_convertible_p (TREE_TYPE (origin), arg))
continue;
arg = fold_convert_loc (gimple_location (stmt),
TREE_TYPE (origin), arg);
}
if (debug_args == NULL)
debug_args = decl_debug_args_insert (callee_decl);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
for (ix = 0; vec_safe_iterate (*debug_args, ix, &ddecl); ix += 2)
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
if (ddecl == origin)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
ddecl = (**debug_args)[ix + 1];
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
break;
}
if (ddecl == NULL)
{
ddecl = make_node (DEBUG_EXPR_DECL);
DECL_ARTIFICIAL (ddecl) = 1;
TREE_TYPE (ddecl) = TREE_TYPE (origin);
Add SET_DECL_MODE This may no longer be necessary with the current version of the SVE patches, but it does at least make things consistent with the TYPE_MODE/SET_TYPE_MODE split. gcc/ada/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * gcc-interface/utils.c (create_label_decl): Use SET_DECL_MODE. gcc/c/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * c-decl.c (merge_decls): Use SET_DECL_MODE. (make_label, finish_struct): Likewise. gcc/cp/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * class.c (finish_struct_bits): Use SET_DECL_MODE. (build_base_field_1, layout_class_type, finish_struct_1): Likewise. * decl.c (make_label_decl): Likewise. * pt.c (tsubst_decl): Likewise. gcc/fortran/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * trans-common.c (build_common_decl): Use SET_DECL_MODE. * trans-decl.c (gfc_build_label_decl): Likewise. * trans-types.c (gfc_get_array_descr_info): Likewise. gcc/lto/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * lto.c (offload_handle_link_vars): Use SET_DECL_MODE. gcc/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * tree.h (SET_DECL_MODE): New macro. * cfgexpand.c (avoid_deep_ter_for_debug): Use SET_DECL_MODE. (expand_gimple_basic_block): Likewise. * function.c (split_complex_args): Likeise. * ipa-prop.c (ipa_modify_call_arguments): Likewise. * omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise. * stor-layout.c (layout_decl, relayout_decl): Likewise. (finish_bitfield_representative): Likewise. * tree.c (make_node_stat): Likewise. * tree-inline.c (remap_ssa_name): Likewise. (tree_function_versioning): Likewise. * tree-into-ssa.c (rewrite_debug_stmt_uses): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise. * tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise. * tree-ssa.c (insert_debug_temp_for_var_def): Likewise. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise. * varasm.c (make_debug_expr_from_rtl): Likewise. libcc1/ 2016-11-16 Richard Sandiford <richard.sandiford@arm.com> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> * plugin.cc (plugin_build_add_field): Use SET_DECL_MODE. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r242585
2016-11-18 11:03:12 +01:00
SET_DECL_MODE (ddecl, DECL_MODE (origin));
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_push (*debug_args, origin);
vec_safe_push (*debug_args, ddecl);
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
def_temp = gimple_build_debug_bind (ddecl, unshare_expr (arg), stmt);
re PR debug/47858 (IPA-SRA decreases quality of debug info) PR debug/47858 * gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND. (gimple_build_debug_source_bind_stat): New prototype. (gimple_build_debug_source_bind): Define. (gimple_debug_source_bind_p, gimple_debug_source_bind_get_var, gimple_debug_source_bind_get_value, gimple_debug_source_bind_get_value_ptr, gimple_debug_source_bind_set_var, gimple_debug_source_bind_set_value): New inlines. * gimple.c (gimple_build_debug_source_bind_stat): New function. * gimple-pretty-print.c (dump_gimple_debug): Handle GIMPLE_DEBUG_SOURCE_BIND. * sese.c (rename_uses): Handle gimple_debug_source_bind_p. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-parloops.c (eliminate_local_variables, separate_decls_in_region): Likewise. (separate_decls_in_region_debug): Renamed from separate_decls_in_region_debug_bind. Handle gimple_debug_source_bind_p. * tree.h (decl_debug_args_lookup, decl_debug_args_insert): New prototypes. (DECL_HAS_DEBUG_ARGS_P): Define. (struct tree_function_decl): Add has_debug_args_flag field. * tree.c (debug_args_for_decl): New variable. (decl_debug_args_lookup, decl_debug_args_insert): New functions. * tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts. (rewrite_debug_stmt_uses): New function. (rewrite_stmt): Use it to rewrite debug stmt uses. * rtl.def (DEBUG_PARAMETER_REF): New. * rtl.h (DEBUG_PARAMETER_REF_DECL): Define. * cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle DEBUG_PARAMETER_REF. * rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind debug stmts in the first bb. * tree-inline.c (remap_ssa_name): If remapping default def of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in a source bind debug stmt. (remap_gimple_stmt): Handle gimple_debug_source_bind_p. (maybe_move_debug_stmts_to_successors): Likewise. (copy_debug_stmt): Likewise. Avoid shadowing a variable. (tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy debug args vector from old_decl to new_decl. * ipa-prop.c (ipa_modify_call_arguments): For optimized away or modified parameters, add debug bind stmts before call setting DEBUG_EXPR_DECL which is remembered in debug args vector. * cfgexpand.c (expand_call_stmt): Call expand_debug_expr on DECL_DEBUG_EXPRs from debug args vector. (expand_debug_source_expr): New function. (expand_debug_locations): Use it for source bind insns. (expand_gimple_basic_block): Handle gimple_debug_source_bind_p. * var-tracking.c (prepare_call_arguments): Add debug args to call_arguments if any. * dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr, output_loc_operands, output_loc_operands_raw, resolve_addr_in_expr, compare_loc_operands): Handle DW_OP_GNU_parameter_ref. (get_ref_die_offset, parameter_ref_descriptor): New functions. (mem_loc_descriptor): Handle DEBUG_PARAMETER_REF. (gen_subprogram_die): Handle parameters identified by DEBUG_PARAMETER_REF. * dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref. From-SVN: r175288
2011-06-22 12:41:58 +02:00
gsi_insert_before (&gsi, def_temp, GSI_SAME_STMT);
}
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "replacing stmt:");
print_gimple_stmt (dump_file, gsi_stmt (gsi), 0, 0);
}
new_stmt = gimple_build_call_vec (callee_decl, vargs);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vargs.release ();
if (gimple_call_lhs (stmt))
gimple_call_set_lhs (new_stmt, gimple_call_lhs (stmt));
gimple_set_block (new_stmt, gimple_block (stmt));
if (gimple_has_location (stmt))
gimple_set_location (new_stmt, gimple_location (stmt));
gimple_call_set_chain (new_stmt, gimple_call_chain (stmt));
gimple_call_copy_flags (new_stmt, stmt);
if (gimple_in_ssa_p (cfun))
{
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
if (gimple_vdef (stmt))
{
gimple_set_vdef (new_stmt, gimple_vdef (stmt));
SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
}
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "with stmt:");
print_gimple_stmt (dump_file, new_stmt, 0, 0);
fprintf (dump_file, "\n");
}
gsi_replace (&gsi, new_stmt, true);
if (cs)
IPA C++ refactoring 4/N * cgraph.h (symtab_node): (bool needed_p (void)): created from decide_is_symbol_needed (bool referred_to_p (void)): created from referred_to_p (static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm * cgraph.h (cgraph_node): (void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases (void expand (void)): created from expand_function (static void finalize_function (tree, bool)): created from cgraph_finalize_function (static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info (static cgraph_global_info *global_info (tree)): created from cgraph_global_info (static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info * cgraph.h (varpool_node): (static void add (tree decl): created from varpool_add_new_variable * cgraph.h (cgraph_edge): void remove (void); (void remove_caller (void)): created from cgraph_edge_remove_caller (void remove_callee (void)): created from cgraph_edge_remove_callee (void set_call_stmt (gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt (void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee (cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct (cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count, gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative (void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)): created from cgraph_speculative_call_info (cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale, int freq_scale, bool update_original)): created from cgraph_clone_edge (cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation (bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p (bool recursive_p (void)): created from cgraph_edge_recursive_p (bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p (static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges (static void rebuild_references (void)): created from cgraph_rebuild_references * cgraph.h (symbol_table): (create_reference): renamed from add_reference (maybe_create_reference): renamed from maybe_add_reference (void register_symbol (symtab_node *node)): new function (void clear_asm_symbols (void)): new function (void unregister (symtab_node *node)): new function (void release_symbol (cgraph_node *node, int uid)): new function (cgraph_node * allocate_cgraph_symbol (void)): new function (void initialize (void)): created from cgraph_init (symtab_node *first_symbol (void)):new function (asm_node *first_asm_symbol (void)):new function (symtab_node *first_defined_symbol (void)):new function (varpool_node *first_variable (void)):new function (varpool_node *next_variable (varpool_node *node)):new function (varpool_node *first_static_initializer (void)):new function (varpool_node *next_static_initializer (varpool_node *node)):new function (varpool_node *first_defined_variable (void)):new function (varpool_node *next_defined_variable (varpool_node *node)):new function (cgraph_node *first_defined_function (void)):new function (cgraph_node *next_defined_function (cgraph_node *node)):new function (cgraph_node *first_function (void)):new function (cgraph_node *next_function (cgraph_node *node)):new function (cgraph_node *first_function_with_gimple_body (void)):new function (asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node (bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)): created from symtab_remove_unreachable_nodes (void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls (void process_new_functions (void)): created from cgraph_process_new_functions (void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases (bool output_variables (void)): created from varpool_node::output_variables (void output_asm_statements (void)): created from output_asm_statements (void finalize_compilation_unit (void)): created from finalize_compilation_unit (void compile (void)): created from compile (void output_weakrefs (void)): created from output_weakrefs (cgraph_node *create_empty (void)): created from cgraph_node::create_empty (cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge (void free_edge (cgraph_edge *e)): created from cgraph_free_edge (cgraph_node *next_function_with_gimple_body (cgraph_node *node)): created from cgraph_next_function_with_gimple_body (void remove_edge_removal_hook (cgraph_edge_hook_list *)): created from cgraph_remove_edge_removal_hook (cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)): created from cgraph_add_node_removal_hook (void remove_cgraph_removal_hook (cgraph_node_hook_list *)): created from cgraph_remove_node_removal_hook (varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)): created from varpool_add_node_removal_hook (void remove_varpool_removal_hook (varpool_node_hook_list *)): created from varpool_remove_node_removal_hook (cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)): created from cgraph_add_function_insertion_hook (void remove_cgraph_insertion_hook (cgraph_node_hook_list *)): created from cgraph_remove_function_insertion_hook (varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)): created from varpool_add_variable_insertion_hook (void remove_varpool_insertion_hook (varpool_node_hook_list *)): created from varpool_remove_variable_insertion_hook (cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)): created from cgraph_add_edge_duplication_hook (void remove_edge_duplication_hook (cgraph_2edge_hook_list *)): created from cgraph_remove_edge_duplication_hook (cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)): created from cgraph_add_node_duplication_hook (void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)): created from cgraph_remove_node_duplication_hook (void call_edge_removal_hooks (cgraph_edge *e)): created from cgraph_call_edge_removal_hooks (void call_cgraph_insertion_hooks (cgraph_node *node)): created from call_function_insertion_hooks (void call_cgraph_removal_hooks (cgraph_node *node)): created from cgraph_call_node_removal_hooks (void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)): created from cgraph_node::call_duplication_hooks (void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)): created from cgraph_call_edge_duplication_hooks (void call_varpool_removal_hooks (varpool_node *node)): created from varpool_call_node_removal_hooks (void call_varpool_insertion_hooks (varpool_node *node)): created from varpool_call_variable_insertion_hooks (void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)): created from insert_to_assembler_name_hash (void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)): created from unlink_from_assembler_name_hash (void symtab_prevail_in_asm_name_hash (symtab_node *node)): created from symtab_prevail_in_asm_name_hash (void symtab_initialize_asm_name_hash (void)): created from symtab_initialize_asm_name_hash (void change_decl_assembler_name (tree decl, tree name)): created from change_decl_assembler_name (void materialize_all_clones (void)): created from cgraph_materialize_all_clones (static hashval_t decl_assembler_name_hash (const_tree asmname)): created from decl_assembler_name_hash (static bool decl_assembler_name_equal (tree decl, const_tree asmname)): created from decl_assembler_name_equal (static hashval_t hash_node_by_assembler_name (const void *p)): created from hash_node_by_assembler_name (static int eq_assembler_name (const void *p1, const void *p2)): created from eq_assembler_name From-SVN: r214422
2014-08-25 15:01:47 +02:00
cs->set_call_stmt (new_stmt);
do
{
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
current_node->record_stmt_references (gsi_stmt (gsi));
gsi_prev (&gsi);
}
while (gsi_stmt (gsi) != gsi_stmt (prev_gsi));
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
/* If the expression *EXPR should be replaced by a reduction of a parameter, do
so. ADJUSTMENTS is a pointer to a vector of adjustments. CONVERT
specifies whether the function should care about type incompatibility the
current and new expressions. If it is false, the function will leave
incompatibility issues to the caller. Return true iff the expression
was modified. */
bool
ipa_modify_expr (tree *expr, bool convert,
ipa_parm_adjustment_vec adjustments)
{
struct ipa_parm_adjustment *cand
= ipa_get_adjustment_candidate (&expr, &convert, adjustments, false);
if (!cand)
return false;
tree src;
if (cand->by_ref)
{
src = build_simple_mem_ref (cand->new_decl);
REF_REVERSE_STORAGE_ORDER (src) = cand->reverse;
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
else
src = cand->new_decl;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "About to replace expr ");
print_generic_expr (dump_file, *expr, 0);
fprintf (dump_file, " with ");
print_generic_expr (dump_file, src, 0);
fprintf (dump_file, "\n");
}
if (convert && !useless_type_conversion_p (TREE_TYPE (*expr), cand->type))
{
tree vce = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (*expr), src);
*expr = vce;
}
else
*expr = src;
return true;
}
/* If T is an SSA_NAME, return NULL if it is not a default def or
return its base variable if it is. If IGNORE_DEFAULT_DEF is true,
the base variable is always returned, regardless if it is a default
def. Return T if it is not an SSA_NAME. */
static tree
get_ssa_base_param (tree t, bool ignore_default_def)
{
if (TREE_CODE (t) == SSA_NAME)
{
if (ignore_default_def || SSA_NAME_IS_DEFAULT_DEF (t))
return SSA_NAME_VAR (t);
else
return NULL_TREE;
}
return t;
}
/* Given an expression, return an adjustment entry specifying the
transformation to be done on EXPR. If no suitable adjustment entry
was found, returns NULL.
If IGNORE_DEFAULT_DEF is set, consider SSA_NAMEs which are not a
default def, otherwise bail on them.
If CONVERT is non-NULL, this function will set *CONVERT if the
expression provided is a component reference. ADJUSTMENTS is the
adjustments vector. */
ipa_parm_adjustment *
ipa_get_adjustment_candidate (tree **expr, bool *convert,
ipa_parm_adjustment_vec adjustments,
bool ignore_default_def)
{
if (TREE_CODE (**expr) == BIT_FIELD_REF
|| TREE_CODE (**expr) == IMAGPART_EXPR
|| TREE_CODE (**expr) == REALPART_EXPR)
{
*expr = &TREE_OPERAND (**expr, 0);
if (convert)
*convert = true;
}
HOST_WIDE_INT offset, size, max_size;
bool reverse;
tree base
= get_ref_base_and_extent (**expr, &offset, &size, &max_size, &reverse);
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (!base || size == -1 || max_size == -1)
return NULL;
if (TREE_CODE (base) == MEM_REF)
{
2014-05-06 18:25:05 +02:00
offset += mem_ref_offset (base).to_short_addr () * BITS_PER_UNIT;
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
base = TREE_OPERAND (base, 0);
}
base = get_ssa_base_param (base, ignore_default_def);
if (!base || TREE_CODE (base) != PARM_DECL)
return NULL;
struct ipa_parm_adjustment *cand = NULL;
unsigned int len = adjustments.length ();
for (unsigned i = 0; i < len; i++)
{
struct ipa_parm_adjustment *adj = &adjustments[i];
if (adj->base == base
&& (adj->offset == offset || adj->op == IPA_PARM_OP_REMOVE))
{
cand = adj;
break;
}
}
if (!cand || cand->op == IPA_PARM_OP_COPY || cand->op == IPA_PARM_OP_REMOVE)
return NULL;
return cand;
}
/* Return true iff BASE_INDEX is in ADJUSTMENTS more than once. */
static bool
index_in_adjustments_multiple_times_p (int base_index,
ipa_parm_adjustment_vec adjustments)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
int i, len = adjustments.length ();
bool one = false;
for (i = 0; i < len; i++)
{
struct ipa_parm_adjustment *adj;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adj = &adjustments[i];
if (adj->base_index == base_index)
{
if (one)
return true;
else
one = true;
}
}
return false;
}
/* Return adjustments that should have the same effect on function parameters
and call arguments as if they were first changed according to adjustments in
INNER and then by adjustments in OUTER. */
ipa_parm_adjustment_vec
ipa_combine_adjustments (ipa_parm_adjustment_vec inner,
ipa_parm_adjustment_vec outer)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
int i, outlen = outer.length ();
int inlen = inner.length ();
int removals = 0;
ipa_parm_adjustment_vec adjustments, tmp;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
tmp.create (inlen);
for (i = 0; i < inlen; i++)
{
struct ipa_parm_adjustment *n;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
n = &inner[i];
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (n->op == IPA_PARM_OP_REMOVE)
removals++;
else
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
{
/* FIXME: Handling of new arguments are not implemented yet. */
gcc_assert (n->op != IPA_PARM_OP_NEW);
tmp.quick_push (*n);
}
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adjustments.create (outlen + removals);
for (i = 0; i < outlen; i++)
{
struct ipa_parm_adjustment r;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
struct ipa_parm_adjustment *out = &outer[i];
struct ipa_parm_adjustment *in = &tmp[out->base_index];
memset (&r, 0, sizeof (r));
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
gcc_assert (in->op != IPA_PARM_OP_REMOVE);
if (out->op == IPA_PARM_OP_REMOVE)
{
if (!index_in_adjustments_multiple_times_p (in->base_index, tmp))
{
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
r.op = IPA_PARM_OP_REMOVE;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adjustments.quick_push (r);
}
continue;
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
else
{
/* FIXME: Handling of new arguments are not implemented yet. */
gcc_assert (out->op != IPA_PARM_OP_NEW);
}
r.base_index = in->base_index;
r.type = out->type;
/* FIXME: Create nonlocal value too. */
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (in->op == IPA_PARM_OP_COPY && out->op == IPA_PARM_OP_COPY)
r.op = IPA_PARM_OP_COPY;
else if (in->op == IPA_PARM_OP_COPY)
r.offset = out->offset;
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
else if (out->op == IPA_PARM_OP_COPY)
r.offset = in->offset;
else
r.offset = in->offset + out->offset;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adjustments.quick_push (r);
}
for (i = 0; i < inlen; i++)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
struct ipa_parm_adjustment *n = &inner[i];
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (n->op == IPA_PARM_OP_REMOVE)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adjustments.quick_push (*n);
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
tmp.release ();
return adjustments;
}
/* Dump the adjustments in the vector ADJUSTMENTS to dump_file in a human
friendly way, assuming they are meant to be applied to FNDECL. */
void
ipa_dump_param_adjustments (FILE *file, ipa_parm_adjustment_vec adjustments,
tree fndecl)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
int i, len = adjustments.length ();
bool first = true;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<tree> parms = ipa_get_vector_of_formal_parms (fndecl);
fprintf (file, "IPA param adjustments: ");
for (i = 0; i < len; i++)
{
struct ipa_parm_adjustment *adj;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
adj = &adjustments[i];
if (!first)
fprintf (file, " ");
else
first = false;
fprintf (file, "%i. base_index: %i - ", i, adj->base_index);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
print_generic_expr (file, parms[adj->base_index], 0);
if (adj->base)
{
fprintf (file, ", base: ");
print_generic_expr (file, adj->base, 0);
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (adj->new_decl)
{
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
fprintf (file, ", new_decl: ");
print_generic_expr (file, adj->new_decl, 0);
}
if (adj->new_ssa_base)
{
fprintf (file, ", new_ssa_base: ");
print_generic_expr (file, adj->new_ssa_base, 0);
}
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
if (adj->op == IPA_PARM_OP_COPY)
fprintf (file, ", copy_param");
ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa.c (symtab_remove_unreachable_nodes): Fix up comment typos. * ipa-prop.c (get_vector_of_formal_parm_types): Renamed to ... (ipa_get_vector_of_formal_parm_types): ... this. No longer static. (ipa_modify_formal_parameters): Adjust caller. Remove synth_parm_prefix argument. Use operator enum instead of bit fields. Add assert for properly handling vector of references. Handle creating brand new parameters. (ipa_modify_call_arguments): Use operator enum instead of bit fields. (ipa_combine_adjustments): Same. Assert that IPA_PARM_OP_NEW is not used. (ipa_modify_expr, get_ssa_base_param, ipa_get_adjustment_candidate): New functions. (ipa_dump_param_adjustments): Rename reduction to new_decl. Use operator enum instead of bit fields. * ipa-prop.h (enum ipa_parm_op): New. (struct ipa_parm_adjustment): New field op. Rename reduction to new_decl, new_arg_prefix to arg_prefix and remove remove_param and copy_param. (ipa_modify_formal_parameters): Remove last argument. (ipa_get_vector_of_formal_parm_types, ipa_modify_expr, ipa_get_adjustment_candidate): New prototypes. * tree-sra.c (turn_representatives_into_adjustments): Use operator enum. Set arg_prefix. (get_adjustment_for_base): Use operator enum. (sra_ipa_modify_expr): Rename to ipa_modify_expr and move to ipa-prop.c. (sra_ipa_modify_assign): Rename sra_ipa_modify_expr to ipa_modify_expr. (ipa_sra_modify_function_body): Same. No longer static. (sra_ipa_reset_debug_stmts): Use operator enum. (modify_function): Do not pass prefix argument. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205284
2013-11-22 21:08:44 +01:00
else if (adj->op == IPA_PARM_OP_REMOVE)
fprintf (file, ", remove_param");
else
fprintf (file, ", offset %li", (long) adj->offset);
if (adj->by_ref)
fprintf (file, ", by_ref");
print_node_brief (file, ", type: ", adj->type, 0);
fprintf (file, "\n");
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
parms.release ();
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
/* Dump the AV linked list. */
void
ipa_dump_agg_replacement_values (FILE *f, struct ipa_agg_replacement_value *av)
{
bool comma = false;
fprintf (f, " Aggregate replacements:");
for (; av; av = av->next)
{
fprintf (f, "%s %i[" HOST_WIDE_INT_PRINT_DEC "]=", comma ? "," : "",
av->index, av->offset);
print_generic_expr (f, av->value, 0);
comma = true;
}
fprintf (f, "\n");
}
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
/* Stream out jump function JUMP_FUNC to OB. */
static void
ipa_write_jump_function (struct output_block *ob,
struct ipa_jump_func *jump_func)
{
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
struct ipa_agg_jf_item *item;
struct bitpack_d bp;
int i, count;
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
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
streamer_write_uhwi (ob, jump_func->type);
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
switch (jump_func->type)
{
case IPA_JF_UNKNOWN:
break;
case IPA_JF_CONST:
Integrate lexical block into source_location. gcc: 2012-09-19 Dehao Chen <dehao@google.com> * toplev.c (general_init): Init block_locations. * tree.c (tree_set_block): New. (tree_block): Change to use LOCATION_BLOCK. * tree.h (TREE_SET_BLOCK): New. * final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK. (final_start_function): Likewise. * input.c (expand_location_1): Likewise. * input.h (LOCATION_LOCUS): New. (LOCATION_BLOCK): New. (IS_UNKNOWN_LOCATION): New. * fold-const.c (expr_location_or): Change to use new location. * reorg.c (emit_delay_sequence): Likewise. (try_merge_delay_insns): Likewise. * modulo-sched.c (dump_insn_location): Likewise. * lto-streamer-out.c (lto_output_location_bitpack): Likewise. * lto-cgraph.c (output_node_opt_summary): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * ifcvt.c (noce_try_move): Likewise. (noce_try_store_flag): Likewise. (noce_try_store_flag_constants): Likewise. (noce_try_addcc): Likewise. (noce_try_store_flag_mask): Likewise. (noce_try_cmove): Likewise. (noce_try_cmove_arith): Likewise. (noce_try_minmax): Likewise. (noce_try_abs): Likewise. (noce_try_sign_mask): Likewise. (noce_try_bitop): Likewise. (noce_process_if_block): Likewise. (cond_move_process_if_block): Likewise. (find_cond_trap): Likewise. * ipa-prop.c (ipa_set_jf_constant): Likewise. (ipa_write_jump_function): Likewise. * dwarf2out.c (add_src_coords_attributes): Likewise. * expr.c (expand_expr_real): Likewise. * tree-parloops.c (create_loop_fn): Likewise. * recog.c (peep2_attempt): Likewise. * function.c (free_after_compilation): Likewise. (expand_function_end): Likewise. (set_insn_locations): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * print-rtl.c (print_rtx): Likewise. * profile.c (branch_prob): Likewise. * trans-mem.c (ipa_tm_scan_irr_block): Likewise. * gimplify.c (gimplify_call_expr): Likewise. * except.c (duplicate_eh_regions_1): Likewise. * emit-rtl.c (try_split): Likewise. (make_insn_raw): Likewise. (make_debug_insn_raw): Likewise. (make_jump_insn_raw): Likewise. (make_call_insn_raw): Likewise. (emit_pattern_after_setloc): Likewise. (emit_pattern_after): Likewise. (emit_debug_insn_after): Likewise. (emit_pattern_before): Likewise. (emit_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_call_insn_before_setloc): Likewise. (emit_call_insn_before): Likeise. (emit_debug_insn_before_setloc): Likewise. (emit_copy_of_insn_after): Likewise. (insn_locators_alloc): Remove. (insn_locators_finalize): Remove. (insn_locators_free): Remove. (set_curr_insn_source_location): Remove. (get_curr_insn_source_location): Remove. (set_curr_insn_block): Remove. (get_curr_insn_block): Remove. (locator_scope): Remove. (insn_scope): Change to use new location. (locator_location): Remove. (insn_line): Change to use new location. (locator_file): Remove. (insn_file): Change to use new location. (locator_eq): Remove. (insn_locations_init): New. (insn_locations_finalize): New. (set_curr_insn_location): New. (curr_insn_location): New. * cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location. (expand_gimple_cond): Likewise. (expand_call_stmt): Likewise. (expand_gimple_stmt_1): Likewise. (expand_gimple_basic_block): Likewise. (construct_exit_block): Likewise. (gimple_expand_cfg): Likewise. * cfgcleanup.c (try_forward_edges): Likewise. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. (dump_scope_block): Likewise. (remove_unused_locals): Likewise. * rtl.c (rtx_equal_p_cb): Likewise. (rtx_equal_p): Likewise. * rtl.h (XUINT): New. (INSN_LOCATOR): Remove. (CURR_INSN_LOCATION): Remove. (INSN_LOCATION): New. (INSN_HAS_LOCATION): New. * tree-inline.c (remap_gimple_op_r): Change to use new location. (copy_tree_body_r): Likewise. (copy_phis_for_bb): Likewise. (expand_call_inline): Likewise. * tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise. * tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise. * gimple-streamer-out.c (output_gimple_stmt): Likewise. * combine.c (try_combine): Likewise. * tree-outof-ssa.c (set_location_for_edge): Likewise. (insert_partition_copy_on_edge): Likewise. (insert_value_copy_on_edge): Likewise. (insert_rtx_to_part_on_edge): Likewise. (insert_part_to_rtx_on_edge): Likewise. * basic-block.h (edge_def): Remove field. * gimple.h (gimple_statement_base): Remove field. (gimple_bb): Change to use new location. (gimple_set_block): Likewise. (gimple_has_location): Likewise. * tree-cfg.c (make_cond_expr_edges): Likewise. (make_goto_expr_edges): Likewise. (gimple_can_merge_blocks_p): Likewise. (move_stmt_op): Likewise. (move_block_to_fn): Likewise. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * config/i386/i386.c (x86_output_mi_thunk): Likewise. * config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/ia64/ia64.c (ia64_output_mi_thunk): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/score/score.c (score_output_mi_thunk): Likewise. * config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise. * config/mips/mips.c (mips_output_mi_thunk): Likewise. * cfgrtl.c (unique_locus_on_edge_between_p): Likewise. (unique_locus_on_edge_between_p): Likewise. (emit_nop_for_unique_locus_between): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Likewise. (cfg_layout_merge_blocks): Likewise. * stmt.c (emit_case_nodes): Likewise. gcc/lto: 2012-09-19 Dehao Chen <dehao@google.com> * lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field. libcpp: 2012-09-19 Dehao Chen <dehao@google.com> * include/line-map.h (MAX_SOURCE_LOCATION): New value. (location_adhoc_data_fini): New. (get_combined_adhoc_loc): New. (get_data_from_adhoc_loc): New. (get_location_from_adhoc_loc): New. (location_adhoc_data_map): New. (COMBINE_LOCATION_DATA): New. (IS_ADHOC_LOC): New. (expanded_location): New field. (line_maps): New field. * line-map.c (location_adhoc_data): New. (location_adhoc_data_hash): New. (location_adhoc_data_eq): New. (location_adhoc_data_update): New. (get_combined_adhoc_loc): New. (get_data_from_adhoc_loc): New. (get_location_from_adhoc_loc): New. (location_adhoc_data_init): New. (location_adhoc_data_fini): New. (linemap_init): Initialize location_adhoc_data. (linemap_lookup): Change to use new location. (linemap_ordinary_map_lookup): Likewise. (linemap_macro_map_lookup): Likewise. (linemap_macro_map_loc_to_def_point): Likewise. (linemap_macro_map_loc_unwind_toward_spel): Likewise. (linemap_get_expansion_line): Likewise. (linemap_get_expansion_filename): Likewise. (linemap_location_in_system_header_p): Likewise. (linemap_location_from_macro_expansion_p): Likewise. (linemap_macro_loc_to_spelling_point): Likewise. (linemap_macro_loc_to_def_point): Likewise. (linemap_macro_loc_to_exp_point): Likewise. (linemap_resolve_location): Likewise. (linemap_unwind_toward_expansion): Likewise. (linemap_unwind_to_first_non_reserved_loc): Likewise. (linemap_expand_location): Likewise. (linemap_dump_location): Likewise. (linemap_line_start): Likewise. From-SVN: r191494
2012-09-19 21:56:42 +02:00
gcc_assert (
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
EXPR_LOCATION (jump_func->value.constant.value) == UNKNOWN_LOCATION);
stream_write_tree (ob, jump_func->value.constant.value, true);
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
break;
case IPA_JF_PASS_THROUGH:
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_uhwi (ob, jump_func->value.pass_through.operation);
if (jump_func->value.pass_through.operation == NOP_EXPR)
{
streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id);
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, jump_func->value.pass_through.agg_preserved, 1);
streamer_write_bitpack (&bp);
}
else if (TREE_CODE_CLASS (jump_func->value.pass_through.operation)
== tcc_unary)
streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id);
else
{
stream_write_tree (ob, jump_func->value.pass_through.operand, true);
streamer_write_uhwi (ob, jump_func->value.pass_through.formal_id);
}
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
break;
case IPA_JF_ANCESTOR:
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_uhwi (ob, jump_func->value.ancestor.offset);
streamer_write_uhwi (ob, jump_func->value.ancestor.formal_id);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, jump_func->value.ancestor.agg_preserved, 1);
streamer_write_bitpack (&bp);
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
break;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
count = vec_safe_length (jump_func->agg.items);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
streamer_write_uhwi (ob, count);
if (count)
{
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, jump_func->agg.by_ref, 1);
streamer_write_bitpack (&bp);
}
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_SAFE_ELT (jump_func->agg.items, i, item)
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
{
streamer_write_uhwi (ob, item->offset);
stream_write_tree (ob, item->value, true);
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-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
bp = bitpack_create (ob->main_stream);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
bp_pack_value (&bp, !!jump_func->bits, 1);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
streamer_write_bitpack (&bp);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (jump_func->bits)
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
streamer_write_widest_int (ob, jump_func->bits->value);
streamer_write_widest_int (ob, jump_func->bits->mask);
}
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
bp_pack_value (&bp, !!jump_func->m_vr, 1);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
streamer_write_bitpack (&bp);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (jump_func->m_vr)
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
{
streamer_write_enum (ob->main_stream, value_rang_type,
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
VR_LAST, jump_func->m_vr->type);
stream_write_tree (ob, jump_func->m_vr->min, true);
stream_write_tree (ob, jump_func->m_vr->max, true);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
}
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
}
/* Read in jump function JUMP_FUNC from IB. */
static void
ipa_read_jump_function (struct lto_input_block *ib,
struct ipa_jump_func *jump_func,
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
struct cgraph_edge *cs,
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
struct data_in *data_in)
{
enum jump_func_type jftype;
enum tree_code operation;
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
int i, count;
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
jftype = (enum jump_func_type) streamer_read_uhwi (ib);
switch (jftype)
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
{
case IPA_JF_UNKNOWN:
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipa_set_jf_unknown (jump_func);
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
break;
case IPA_JF_CONST:
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
ipa_set_jf_constant (jump_func, stream_read_tree (ib, data_in), cs);
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
break;
case IPA_JF_PASS_THROUGH:
operation = (enum tree_code) streamer_read_uhwi (ib);
if (operation == NOP_EXPR)
{
int formal_id = streamer_read_uhwi (ib);
struct bitpack_d bp = streamer_read_bitpack (ib);
bool agg_preserved = bp_unpack_value (&bp, 1);
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_jf_simple_pass_through (jump_func, formal_id, agg_preserved);
}
else if (TREE_CODE_CLASS (operation) == tcc_unary)
{
int formal_id = streamer_read_uhwi (ib);
ipa_set_jf_unary_pass_through (jump_func, formal_id, operation);
}
else
{
tree operand = stream_read_tree (ib, data_in);
int formal_id = streamer_read_uhwi (ib);
ipa_set_jf_arith_pass_through (jump_func, formal_id, operand,
operation);
}
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
break;
case IPA_JF_ANCESTOR:
{
HOST_WIDE_INT offset = streamer_read_uhwi (ib);
int formal_id = streamer_read_uhwi (ib);
struct bitpack_d bp = streamer_read_bitpack (ib);
bool agg_preserved = bp_unpack_value (&bp, 1);
ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. 2014-11-14 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE. (ipa_pass_through_data): Removed field type_preserved. (ipa_ancestor_jf_data): removed fields type and type_preserved. (ipa_jump_func): Removed field known_type. (ipa_get_jf_known_type_offset): Removed. (ipa_get_jf_known_type_base_type): Likewise. (ipa_get_jf_known_type_component_type): Likewise. (ipa_get_jf_ancestor_type): Likewise. * ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling. (ipa_get_jf_pass_through_result): Likewise. (ipa_get_jf_ancestor_result): Always build ptr_node_type accesses. (values_equal_for_ipcp_p): Removed BINFO handling. (ipa_get_indirect_edge_target_1): Updated comment. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields. (ipa_set_jf_known_type): Removed. (ipa_set_jf_simple_pass_through): Do not set removed fields. Update all callers. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (ipa_binfo_from_known_type_jfunc): Removed. (prop_type_change_info): Removed fields known_current_type and multiple_types_encountered. (extr_type_from_vtbl_ptr_store): Removed. (check_stmt_for_type_change): Do not attempt to identify changed type. (detect_type_change_from_memory_writes): Do not set the removed fields, always set jfunc to unknown. (compute_complex_assign_jump_func): Do not detect dynamic type change. (compute_complex_ancestor_jump_func): Likewise. (compute_known_type_jump_func): Removed. (ipa_compute_jump_functions_for_edge): Do not detect dynamic type change. Do not comute known type jump functions. (combine_known_type_and_ancestor_jfs): Removed. (update_jump_functions_after_inlining): Removed handling of IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields. (ipa_write_jump_function): Do not stream removed fields or known type jump functions. (ipa_read_jump_function): Likewise. From-SVN: r217589
2014-11-14 21:07:39 +01:00
ipa_set_ancestor_jf (jump_func, offset, formal_id, agg_preserved);
break;
}
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
}
count = streamer_read_uhwi (ib);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_alloc (jump_func->agg.items, count);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
if (count)
{
struct bitpack_d bp = streamer_read_bitpack (ib);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
jump_func->agg.by_ref = bp_unpack_value (&bp, 1);
}
for (i = 0; i < count; i++)
{
struct ipa_agg_jf_item item;
item.offset = streamer_read_uhwi (ib);
item.value = stream_read_tree (ib, data_in);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
jump_func->agg.items->quick_push (item);
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-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
struct bitpack_d bp = streamer_read_bitpack (ib);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
bool bits_known = bp_unpack_value (&bp, 1);
if (bits_known)
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
widest_int value = streamer_read_widest_int (ib);
widest_int mask = streamer_read_widest_int (ib);
ipa_set_jfunc_bits (jump_func, value, mask);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
}
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
jump_func->bits = NULL;
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
struct bitpack_d vr_bp = streamer_read_bitpack (ib);
bool vr_known = bp_unpack_value (&vr_bp, 1);
if (vr_known)
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
enum value_range_type type = streamer_read_enum (ib, value_range_type,
VR_LAST);
tree min = stream_read_tree (ib, data_in);
tree max = stream_read_tree (ib, data_in);
ipa_set_jfunc_vr (jump_func, type, min, max);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
}
else
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
jump_func->m_vr = NULL;
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
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
/* Stream out parts of cgraph_indirect_call_info corresponding to CS that are
relevant to indirect inlining to OB. */
static void
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
ipa_write_indirect_edge_info (struct output_block *ob,
struct cgraph_edge *cs)
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
struct cgraph_indirect_call_info *ii = cs->indirect_info;
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
struct bitpack_d bp;
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_hwi (ob, ii->param_index);
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, ii->polymorphic, 1);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
bp_pack_value (&bp, ii->agg_contents, 1);
bp_pack_value (&bp, ii->member_ptr, 1);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
bp_pack_value (&bp, ii->by_ref, 1);
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
bp_pack_value (&bp, ii->guaranteed_unmodified, 1);
bp_pack_value (&bp, ii->vptr_changed, 1);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_bitpack (&bp);
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
if (ii->agg_contents || ii->polymorphic)
streamer_write_hwi (ob, ii->offset);
else
gcc_assert (ii->offset == 0);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (ii->polymorphic)
{
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_hwi (ob, ii->otr_token);
tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start. * tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start. (lto_output_ts_binfo_tree_pointers): Likewise. * streamer-hooks.h (stream_write_tree): Move from tree-streamer.h. Convert it to a macro. (stream_read_tree): Likewise. * lto-streamer.h (lto_stream_as_builtin_p): Move ... * tree-streamer.h (lto_stream_as_builtin_p): ... here. * lto-streamer-in.c (lto_read_tree): Call lto_streamer_cache_append and tree_read_bitfields. * lto-streamer-out.c (lto_is_streamable): Move from lto-streamer.c (lto_write_tree): Call it. * lto-streamer.c (lto_is_streamable): Move to lto-streamer-out.c * streamer-hooks.h (struct streamer_hooks): Remove fields name, is_streamable and alloc_tree. Update all users. * tree-streamer-in.c (tree_read_bitfields): Factor out of ... (lto_materialize_tree): ... here. Handle CALL_EXPR codes. Remove call to lto_streamer_cache_append. * tree-streamer-out.c (lto_output_tree_header): Handle CALL_EXPR nodes. * tree-streamer.h (tree_read_bitfields): Declare. * Makefile.in (TREE_STREAMER_H): Add STREAMER_HOOKS_H. (gimple-streamer-in.o): Add dependency on TREE_STREAMER_H. * tree-streamer.h (stream_read_tree): New. Replace all calls to lto_input_tree with it. (stream_write_tree): New. Replace all calls to lto_output_tree, lto_output_tree_ref and lto_output_tree_or_ref with it. * lto-streamer-in.c (lto_read_tree): Inline code from lto_streamer_read_tree. (lto_input_tree): Move from tree-streamer-in.c. * lto-streamer-out.c (lto_output_tree_ref): Make static. Remove handling of NULL values for EXPR. Do not handle EXPRs that are not indexable. (lto_write_tree): Move from tree-streamer-out.c. Inline lto_streamer_write_tree. (lto_output_tree): Move from tree-streamer-out.c. If REF_P is true and EXPR is indexable, call lto_output_tree_ref. * lto-streamer.c (lto_record_common_node): Move to tree-streamer.c. (lto_preload_common_nodes): Likewise. Remove assertions and adjustments for nodes main_identifier_node, ptrdiff_type_node and fileptr_type_node. (lto_streamer_hooks_init): Set streamer_hooks.write_tree to lto_output_tree and streamer_hooks.read_tree to lto_input_tree. * lto-streamer.h (lto_input_tree): Declare. (lto_output_tree_ref): Remove. * streamer-hooks.h (struct streamer_hooks): Remove fields preload_common_nodes, indexable_with_decls_p, pack_value_fields, unpack_value_fields, output_tree_header and has_unique_integer_csts_p. Update all users. * tree-streamer-in.c (lto_materialize_tree): Make extern. (lto_input_tree_pointers): Likewise. (lto_read_tree): Move to lto-streamer-in.c. (lto_input_integer_cst): Make extern. (lto_get_pickled_tree): Likewise. (lto_get_builtin_tree): Likewise. (lto_input_tree): Move to lto-streamer-in.c. * tree-streamer-out.c (pack_value_fields): Make extern. (lto_output_tree_or_ref): Remove. Replace all callers with calls to stream_write_tree. (lto_output_builtin_tree): Make extern. (lto_streamer_write_tree): Inline into lto_write_tree. (lto_output_tree_pointers): Make extern. (lto_output_tree_header): Likewise. (lto_output_integer_cst): Likewise. (lto_write_tree): Move to lto-streamer-out.c. (lto_output_tree): Likewise. * tree-streamer.c (lto_record_common_node): Move from lto-streamer.c (preload_common_nodes): Likewise. (lto_streamer_cache_create): Call it. * tree-streamer.h: Include streamer-hooks.h. (stream_write_tree): New. (stream_read_tree): New. (lto_input_tree): Remove. (lto_materialize_tree): Declare. (lto_input_tree_pointers): Declare. (lto_get_pickled_tree): Declare. (lto_get_builtin_tree): Declare. (lto_input_integer_cst): Declare. (lto_output_tree_header): Declare. (pack_value_fields): Declare. (lto_output_tree_pointers): Declare. (lto_output_integer_cst): Declare. (lto_output_builtin_tree): Declare. From-SVN: r177661
2011-08-11 14:02:34 +02:00
stream_write_tree (ob, ii->otr_type, true);
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
ii->context.stream_out (ob);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
/* Read in parts of cgraph_indirect_call_info corresponding to CS that are
relevant to indirect inlining from IB. */
static void
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
ipa_read_indirect_edge_info (struct lto_input_block *ib,
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
struct data_in *data_in,
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
struct cgraph_edge *cs)
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
struct cgraph_indirect_call_info *ii = cs->indirect_info;
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
struct bitpack_d bp;
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
ii->param_index = (int) streamer_read_hwi (ib);
bp = streamer_read_bitpack (ib);
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
ii->polymorphic = bp_unpack_value (&bp, 1);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ii->agg_contents = bp_unpack_value (&bp, 1);
ii->member_ptr = bp_unpack_value (&bp, 1);
cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. 2012-08-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): Field anc_offse renamd to offset, updated all users. New field agg_contents. * ipa-prop.h (jump_func_type): Removed IPA_JF_CONST_MEMBER_PTR. (ipa_pass_through_data): New field agg_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_member_ptr_cst): Removed. (ipa_agg_jf_item): New type. (ipa_agg_jump_function): Likewise. (ipa_jump_func): New field agg. Removed field member_cst. (ipa_get_jf_pass_through_agg_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Likewise. (ipa_get_jf_member_ptr_pfn): Removed. (ipa_find_agg_cst_for_param): Declare. (ipa_load_from_parm_agg): Likewise. * ipa-prop.c (param_analysis_info): Fields modified and visited_statements rename to parm_modified and parm_visited_statements respectively, added fields ref_modified, ref_visited_statements, pt_modified and pt_visited_statements. (ipa_print_node_jump_functions_for_edge): Do not dump const member functions. Dump agg_preserved flags and aggregate jump functions. (ipa_set_jf_simple_pass_through): Set also agg_preserved. (ipa_set_ancestor_jf): Likewise. (ipa_set_jf_arith_pass_through): Clear agg_preserved. (ipa_set_jf_member_ptr_cst): Removed. (is_parm_modified_before_stmt): Logic reversed, renamed to parm_preserved_before_stmt_p. Cache visited bitmap only for naked DECL parameters. All callers updated. (load_from_unmodified_param): Allow NULL parms_ainfo. (parm_ref_data_preserved_p): New function. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. (ipa_load_from_parm_agg): Likewise. (compute_complex_assign_jump_func): Check if aggregate contents are preserved. (compute_complex_ancestor_jump_func): Likewise. (compute_scalar_jump_functions): Removed. (type_like_member_ptr_p): Also check field position are known and sane. (compute_pass_through_member_ptrs): Removed. (determine_cst_member_ptr): Likewise. (ipa_known_agg_contents_list): New type. (determine_known_aggregate_parts): New function. (compute_cst_member_ptr_arguments): Removed. (ipa_compute_jump_functions_for_edge): Compute all kinds of jump functions (scalar, aggregate and member pointer). (ipa_get_member_ptr_load_param): Incorporate into ipa_get_stmt_member_ptr_load_param, also pass back an offset. (ipa_note_param_call): Clear agg_contents. (ipa_analyze_indirect_call_uses): Also look for simple pointers loaded from aggregates. In such cases, store offset of the called field. (ipa_analyze_node): Initialize new fields of param_analysis_info. (update_jump_functions_after_inlining): Handle aggregate contents. (ipa_find_agg_cst_for_param): New function. (try_make_edge_direct_simple_call): Handle called aggregate values. (update_indirect_edges_after_inlining): Make sure aggregate preserving jump functions comply with type compatibility requirements. (ipa_edge_duplication_hook): Copy also aggregate jump functions. (ipa_write_jump_function): Stream agg_preserved flags and aggregate jump functions. Do not stream member pointer constant jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new cgraph_indirect_call_info fields. (ipa_read_indirect_edge_info): Likewise. * testsuite/gcc.dg/ipa/iinline-4.c: New test. * testsuite/gcc.dg/ipa/iinline-5.c: Likewise. * testsuite/gcc.dg/ipa/iinline-6.c: Likewise. * testsuite/gcc.dg/ipa/iinline-7.c: Likewise. * testsuite/gcc.dg/lto/20120723_0.c: Likewise. * testsuite/gcc.dg/lto/20120723_1.c: Likewise. From-SVN: r190260
2012-08-09 18:05:46 +02:00
ii->by_ref = bp_unpack_value (&bp, 1);
Indirect inlining of targets from references of global constants 2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
2016-05-18 18:38:56 +02:00
ii->guaranteed_unmodified = bp_unpack_value (&bp, 1);
ii->vptr_changed = bp_unpack_value (&bp, 1);
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
if (ii->agg_contents || ii->polymorphic)
ii->offset = (HOST_WIDE_INT) streamer_read_hwi (ib);
else
ii->offset = 0;
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
if (ii->polymorphic)
{
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
ii->otr_token = (HOST_WIDE_INT) streamer_read_hwi (ib);
tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start. * tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start. (lto_output_ts_binfo_tree_pointers): Likewise. * streamer-hooks.h (stream_write_tree): Move from tree-streamer.h. Convert it to a macro. (stream_read_tree): Likewise. * lto-streamer.h (lto_stream_as_builtin_p): Move ... * tree-streamer.h (lto_stream_as_builtin_p): ... here. * lto-streamer-in.c (lto_read_tree): Call lto_streamer_cache_append and tree_read_bitfields. * lto-streamer-out.c (lto_is_streamable): Move from lto-streamer.c (lto_write_tree): Call it. * lto-streamer.c (lto_is_streamable): Move to lto-streamer-out.c * streamer-hooks.h (struct streamer_hooks): Remove fields name, is_streamable and alloc_tree. Update all users. * tree-streamer-in.c (tree_read_bitfields): Factor out of ... (lto_materialize_tree): ... here. Handle CALL_EXPR codes. Remove call to lto_streamer_cache_append. * tree-streamer-out.c (lto_output_tree_header): Handle CALL_EXPR nodes. * tree-streamer.h (tree_read_bitfields): Declare. * Makefile.in (TREE_STREAMER_H): Add STREAMER_HOOKS_H. (gimple-streamer-in.o): Add dependency on TREE_STREAMER_H. * tree-streamer.h (stream_read_tree): New. Replace all calls to lto_input_tree with it. (stream_write_tree): New. Replace all calls to lto_output_tree, lto_output_tree_ref and lto_output_tree_or_ref with it. * lto-streamer-in.c (lto_read_tree): Inline code from lto_streamer_read_tree. (lto_input_tree): Move from tree-streamer-in.c. * lto-streamer-out.c (lto_output_tree_ref): Make static. Remove handling of NULL values for EXPR. Do not handle EXPRs that are not indexable. (lto_write_tree): Move from tree-streamer-out.c. Inline lto_streamer_write_tree. (lto_output_tree): Move from tree-streamer-out.c. If REF_P is true and EXPR is indexable, call lto_output_tree_ref. * lto-streamer.c (lto_record_common_node): Move to tree-streamer.c. (lto_preload_common_nodes): Likewise. Remove assertions and adjustments for nodes main_identifier_node, ptrdiff_type_node and fileptr_type_node. (lto_streamer_hooks_init): Set streamer_hooks.write_tree to lto_output_tree and streamer_hooks.read_tree to lto_input_tree. * lto-streamer.h (lto_input_tree): Declare. (lto_output_tree_ref): Remove. * streamer-hooks.h (struct streamer_hooks): Remove fields preload_common_nodes, indexable_with_decls_p, pack_value_fields, unpack_value_fields, output_tree_header and has_unique_integer_csts_p. Update all users. * tree-streamer-in.c (lto_materialize_tree): Make extern. (lto_input_tree_pointers): Likewise. (lto_read_tree): Move to lto-streamer-in.c. (lto_input_integer_cst): Make extern. (lto_get_pickled_tree): Likewise. (lto_get_builtin_tree): Likewise. (lto_input_tree): Move to lto-streamer-in.c. * tree-streamer-out.c (pack_value_fields): Make extern. (lto_output_tree_or_ref): Remove. Replace all callers with calls to stream_write_tree. (lto_output_builtin_tree): Make extern. (lto_streamer_write_tree): Inline into lto_write_tree. (lto_output_tree_pointers): Make extern. (lto_output_tree_header): Likewise. (lto_output_integer_cst): Likewise. (lto_write_tree): Move to lto-streamer-out.c. (lto_output_tree): Likewise. * tree-streamer.c (lto_record_common_node): Move from lto-streamer.c (preload_common_nodes): Likewise. (lto_streamer_cache_create): Call it. * tree-streamer.h: Include streamer-hooks.h. (stream_write_tree): New. (stream_read_tree): New. (lto_input_tree): Remove. (lto_materialize_tree): Declare. (lto_input_tree_pointers): Declare. (lto_get_pickled_tree): Declare. (lto_get_builtin_tree): Declare. (lto_input_integer_cst): Declare. (lto_output_tree_header): Declare. (pack_value_fields): Declare. (lto_output_tree_pointers): Declare. (lto_output_integer_cst): Declare. (lto_output_builtin_tree): Declare. From-SVN: r177661
2011-08-11 14:02:34 +02:00
ii->otr_type = stream_read_tree (ib, data_in);
cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-25 03:48:34 +02:00
ii->context.stream_in (ib, data_in);
cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-17 21:43:40 +02:00
}
}
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
/* Stream out NODE info to OB. */
static void
ipa_write_node_info (struct output_block *ob, struct cgraph_node *node)
{
int node_ref;
cgraph.h (vector types for symtab_node): Add. * cgraph.h (vector types for symtab_node): Add. * ipa-reference.c (ipa_reference_write_optimization_summary): Update for new symtab encoder. (ipa_reference_read_optimization_summary): Likewise. * lto-cgraph.c (output_varpool): Remove. (input_cgraph_opt_summary): Take symtab nodes vector as argument. (LTO_cgraph_tags): Rename to ... (LTO_symtab_tags): ... this one; add LTO_symtab_variable. (lto_cgraph_encoder_new): Rename to ... (lto_symtab_encoder_new): ... this on. (lto_cgraph_encoder_encode): Rename to ... (lto_symtab_encoder_encode): ... this one. (lto_cgraph_encoder_delete): Rename to ... (lto_symtab_encoder_delete): ... this one. (lto_cgraph_encoder_deref): Rename to ... (lto_symtab_encoder_deref): ... this one. (lto_cgraph_encoder_encode_body_p): Rename to ... (lto_symtab_encoder_encode_body_p): ... this one. (lto_varpool_encoder_new, lto_varpool_encoder_delete, lto_varpool_encoder_encode, lto_varpool_encoder_lookup, lto_varpool_encoder_deref): Remove. (lto_varpool_encoder_encode_initializer_p): Rename to ... (lto_symtab_encoder_encode_initializer_p): ... this one. (lto_set_varpool_encoder_encode_initializer): Rename to ... (lto_set_symtab_encoder_encode_initializer): ... this one. (lto_output_edge): Update. (lto_output_node): Update. (lto_output_varpool_node): Update; stream out LTO_symtab_variable tag. (lto_output_ref): Drop varpool_encoder; update. (add_node_to): Update. (add_references): Update. (output_outgoing_cgraph_edges): Update. (output_refs): Update. (compute_ltrans_boundary): Update. (output_cgraph): Update; output varpools too. (input_overwrite_node): Update. (output_varpool): Remove. (input_node): Update. (input_ref): Update. (input_edge): Update. (input_cgraph_1): Update; input varpool too; unify fixup code. (input_varpool_1): Remove. (input_refs): Update. (input_cgraph): Update. (output_node_opt_summary): Update. (input_cgraph_opt_section): Update. (input_cgraph_opt_summary): Update. * ipa-pure-const.c (pure_const_write_summary): Update. (pure_const_read_summary): Update. * lto-streamer-out.c (lto_write_tree): Update. (lto_output): Likewise. (produce_symtab): Update. (produce_asm_for_decls): Update. * ipa-inline-analysis.c (inline_read_section): Update. (inline_write_summary): Update. * ipa-prop.c (ipa_write_node_info): Update. (ipa_prop_read_section): Update. * lto-streamer.h (lto_cgraph_encoder_d): Rename to ... (lto_symtab_encoder_d): ... this one; add initializer. (lto_cgraph_encoder_t): Rename to ... (lto_symtab_encoder_t): ... this one. (lto_cgraph_encoder_size): Rename to ... (lto_symtab_encoder_size): ... this one. (lto_varpool_encoder_d): ... remove. (lto_varpool_encoder_t): Remove. (lto_out_decl_state): Remove cgraph_node_encoder, varpool_node_encoder add symtab_node_encoder. (lto_file_decl_data): Likewise. (lto_cgraph_encoder_deref, lto_cgraph_encoder_lookup, lto_cgraph_encoder_new, lto_cgraph_encoder_encode, lto_cgraph_encoder_delete, lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p, lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_new, lto_varpool_encoder_encode, lto_varpool_encoder_delete, lto_varpool_encoder_encode_initializer_p): Remove. (lto_symtab_encoder_deref, lto_symtab_encoder_lookup, lto_symtab_encoder_t, lto_symtab_encoder_encode, lto_symtab_encoder_delete, lto_symtab_encoder_encode_body_p, lto_symtab_encoder_encode_initializer_p): New. From-SVN: r190309
2012-08-11 05:04:35 +02:00
lto_symtab_encoder_t encoder;
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
struct ipa_node_params *info = IPA_NODE_REF (node);
int j;
struct cgraph_edge *e;
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
struct bitpack_d bp;
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
cgraph.h (vector types for symtab_node): Add. * cgraph.h (vector types for symtab_node): Add. * ipa-reference.c (ipa_reference_write_optimization_summary): Update for new symtab encoder. (ipa_reference_read_optimization_summary): Likewise. * lto-cgraph.c (output_varpool): Remove. (input_cgraph_opt_summary): Take symtab nodes vector as argument. (LTO_cgraph_tags): Rename to ... (LTO_symtab_tags): ... this one; add LTO_symtab_variable. (lto_cgraph_encoder_new): Rename to ... (lto_symtab_encoder_new): ... this on. (lto_cgraph_encoder_encode): Rename to ... (lto_symtab_encoder_encode): ... this one. (lto_cgraph_encoder_delete): Rename to ... (lto_symtab_encoder_delete): ... this one. (lto_cgraph_encoder_deref): Rename to ... (lto_symtab_encoder_deref): ... this one. (lto_cgraph_encoder_encode_body_p): Rename to ... (lto_symtab_encoder_encode_body_p): ... this one. (lto_varpool_encoder_new, lto_varpool_encoder_delete, lto_varpool_encoder_encode, lto_varpool_encoder_lookup, lto_varpool_encoder_deref): Remove. (lto_varpool_encoder_encode_initializer_p): Rename to ... (lto_symtab_encoder_encode_initializer_p): ... this one. (lto_set_varpool_encoder_encode_initializer): Rename to ... (lto_set_symtab_encoder_encode_initializer): ... this one. (lto_output_edge): Update. (lto_output_node): Update. (lto_output_varpool_node): Update; stream out LTO_symtab_variable tag. (lto_output_ref): Drop varpool_encoder; update. (add_node_to): Update. (add_references): Update. (output_outgoing_cgraph_edges): Update. (output_refs): Update. (compute_ltrans_boundary): Update. (output_cgraph): Update; output varpools too. (input_overwrite_node): Update. (output_varpool): Remove. (input_node): Update. (input_ref): Update. (input_edge): Update. (input_cgraph_1): Update; input varpool too; unify fixup code. (input_varpool_1): Remove. (input_refs): Update. (input_cgraph): Update. (output_node_opt_summary): Update. (input_cgraph_opt_section): Update. (input_cgraph_opt_summary): Update. * ipa-pure-const.c (pure_const_write_summary): Update. (pure_const_read_summary): Update. * lto-streamer-out.c (lto_write_tree): Update. (lto_output): Likewise. (produce_symtab): Update. (produce_asm_for_decls): Update. * ipa-inline-analysis.c (inline_read_section): Update. (inline_write_summary): Update. * ipa-prop.c (ipa_write_node_info): Update. (ipa_prop_read_section): Update. * lto-streamer.h (lto_cgraph_encoder_d): Rename to ... (lto_symtab_encoder_d): ... this one; add initializer. (lto_cgraph_encoder_t): Rename to ... (lto_symtab_encoder_t): ... this one. (lto_cgraph_encoder_size): Rename to ... (lto_symtab_encoder_size): ... this one. (lto_varpool_encoder_d): ... remove. (lto_varpool_encoder_t): Remove. (lto_out_decl_state): Remove cgraph_node_encoder, varpool_node_encoder add symtab_node_encoder. (lto_file_decl_data): Likewise. (lto_cgraph_encoder_deref, lto_cgraph_encoder_lookup, lto_cgraph_encoder_new, lto_cgraph_encoder_encode, lto_cgraph_encoder_delete, lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p, lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_new, lto_varpool_encoder_encode, lto_varpool_encoder_delete, lto_varpool_encoder_encode_initializer_p): Remove. (lto_symtab_encoder_deref, lto_symtab_encoder_lookup, lto_symtab_encoder_t, lto_symtab_encoder_encode, lto_symtab_encoder_delete, lto_symtab_encoder_encode_body_p, lto_symtab_encoder_encode_initializer_p): New. From-SVN: r190309
2012-08-11 05:04:35 +02:00
encoder = ob->decl_state->symtab_node_encoder;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
node_ref = lto_symtab_encoder_encode (encoder, node);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_uhwi (ob, node_ref);
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
streamer_write_uhwi (ob, ipa_get_param_count (info));
for (j = 0; j < ipa_get_param_count (info); j++)
streamer_write_uhwi (ob, ipa_get_param_move_cost (info, j));
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
bp = bitpack_create (ob->main_stream);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
gcc_assert (info->analysis_done
|| ipa_get_param_count (info) == 0);
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
gcc_assert (!info->node_enqueued);
gcc_assert (!info->ipcp_orig_node);
for (j = 0; j < ipa_get_param_count (info); j++)
ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. 2011-07-18 Martin Jambor <mjambor@suse.cz> * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. (ipcp_values_pool): Declare. (ipcp_sources_pool): Likewise. (ipcp_lattice): Changed to forward declaration. (ipa_param_descriptor): Removed fields ipcp_lattice, types and cannot_devirtualize. (ipa_node_params): New fields descriptors, lattices, known_vals, clone_for_all_contexts and node dead, removed fields params and count_scale. (ipa_set_param_count): Removed. (ipa_get_param_count): Made to work with descriptors vector. (ipa_get_param): Updated. (ipa_param_cannot_devirtualize_p): Removed. (ipa_param_types_vec_empty): Likewise. (ipa_set_param_used): New function. (ipa_get_param_used): Updated to use descriptors vector. (ipa_func_list): Removed. (ipa_init_func_list): Removed declaration. (ipa_push_func_to_list_1): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_push_func_to_list): Removed. (ipa_lattice_from_jfunc): Remove declaration. (ipa_get_jf_pass_through_result): Declare. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_get_lattice): Update. (ipa_lat_is_single_const): New function. * ipa-prop.c (ipa_push_func_to_list_1): Removed. (ipa_init_func_list): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_get_param_decl_index): Fix coding style. (count_formal_params): Removed. (count_formal_params_1): Renamed to count_formal_params. (ipa_populate_param_decls): Update to use descriptors vector. (ipa_initialize_node_params): Likewise. (visit_ref_for_mod_analysis): Use ipa_set_param_used. (ipa_analyze_params_uses): Likewise. (ipa_free_node_params_substructures): Likewise and free also lattices and known values. (duplicate_array): Removed. (ipa_edge_duplication_hook): Add the new edge to the list of edge clones. (ipa_node_duplication_hook): Update to use new lattices. (ipa_free_all_structures_after_ipa_cp): Free alloc pools. (ipa_free_all_structures_after_iinln): Likewise. (ipa_write_node_info): Update to use new lattices. (ipa_read_node_info): Likewise. (ipa_get_jf_pass_through_result): New function. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc. * ipa-cp.c: Reimplemented. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed. (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter. (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise. * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies. * doc/invoke.texi (devirt-type-list-size): Removed description. (ipa-cp-value-list-size): Added description. * testsuite/gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-2.c: Likewise. * testsuite/gcc.dg/ipa/ipa-3.c: Likewise and made functions static. * testsuite/gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-5.c: Likewise. * testsuite/gcc.dg/ipa/ipa-7.c: Likewise. * testsuite/gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipacost-1.c: Likewise. * testsuite/gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some functions. * testsuite/gcc.dg/ipa/ipcp-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-2.c: Likewise. * testsuite/gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. From-SVN: r176424
2011-07-19 00:03:39 +02:00
bp_pack_value (&bp, ipa_is_param_used (info, j), 1);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_bitpack (&bp);
re PR middle-end/42371 (dead code not eliminated during folding with whole-program) 2013-05-13 Martin Jambor <mjambor@suse.cz> PR middle-end/42371 * ipa-prop.h (IPA_UNDESCRIBED_USE): New macro. (ipa_constant_data): New type. (ipa_jump_func): Use ipa_constant_data to hold information about constant jump functions. (ipa_get_jf_constant): Adjust to jump function type changes. (ipa_get_jf_constant_rdesc): New function. (ipa_param_descriptor): New field controlled_uses. (ipa_get_controlled_uses): New function. (ipa_set_controlled_uses): Likewise. * ipa-ref.h (ipa_find_reference): Declare. * ipa-prop.c (ipa_cst_ref_desc): New type. (ipa_print_node_jump_functions_for_edge): Adjust for jump function type changes. (ipa_set_jf_constant): Likewise. Also create reference descriptions. New parameter cs. Adjust all callers. (ipa_analyze_params_uses): Detect uncontrolled and controlled uses. (remove_described_reference): New function. (jfunc_rdesc_usable): Likewise. (try_make_edge_direct_simple_call): Decrement controlled use count, attempt to remove reference if it hits zero. (combine_controlled_uses_counters): New function. (propagate_controlled_uses): Likewise. (ipa_propagate_indirect_call_infos): Call propagate_controlled_uses. (ipa_edge_duplication_hook): Duplicate reference descriptions. (ipa_print_node_params): Print described use counter. (ipa_write_jump_function): Adjust to jump function type changes. (ipa_read_jump_function): New parameter CS, pass it to ipa_set_jf_constant. Adjust caller. (ipa_write_node_info): Stream controlled use count (ipa_read_node_info): Likewise. * cgraph.c (cgraph_mark_address_taken_node): Bail out instead of asserting. * ipa-cp.c (ipcp_discover_new_direct_edges): Decrement controlled use count. Remove cloning-added reference if it reaches zero. * ipa-ref.c (ipa_find_reference): New function. testsuite/ * gcc.dg/ipa/remref-0.c: New test. * gcc.dg/ipa/remref-1a.c: Likewise. * gcc.dg/ipa/remref-1b.c: Likewise. * gcc.dg/ipa/remref-2a.c: Likewise. * gcc.dg/ipa/remref-2b.c: Likewise. From-SVN: r198821
2013-05-13 12:16:09 +02:00
for (j = 0; j < ipa_get_param_count (info); j++)
{
streamer_write_hwi (ob, ipa_get_controlled_uses (info, j));
stream_write_tree (ob, ipa_get_type (info, j), true);
}
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
for (e = node->callees; e; e = e->next_callee)
{
struct ipa_edge_args *args = IPA_EDGE_REF (e);
streamer_write_uhwi (ob,
ipa_get_cs_argument_count (args) * 2
+ (args->polymorphic_call_contexts != NULL));
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
for (j = 0; j < ipa_get_cs_argument_count (args); j++)
{
ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j));
if (args->polymorphic_call_contexts != NULL)
ipa_get_ith_polymorhic_call_context (args, j)->stream_out (ob);
}
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
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
for (e = node->indirect_calls; e; e = e->next_callee)
{
struct ipa_edge_args *args = IPA_EDGE_REF (e);
streamer_write_uhwi (ob,
ipa_get_cs_argument_count (args) * 2
+ (args->polymorphic_call_contexts != NULL));
for (j = 0; j < ipa_get_cs_argument_count (args); j++)
{
ipa_write_jump_function (ob, ipa_get_ith_jump_func (args, j));
if (args->polymorphic_call_contexts != NULL)
ipa_get_ith_polymorhic_call_context (args, j)->stream_out (ob);
}
ipa_write_indirect_edge_info (ob, e);
}
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
}
/* Stream in NODE info from IB. */
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
static void
ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
struct data_in *data_in)
{
struct ipa_node_params *info = IPA_NODE_REF (node);
int k;
struct cgraph_edge *e;
lto-streamer.c (cached_bp): Remove. 2010-06-14 Richard Guenther <rguenther@suse.de> * lto-streamer.c (cached_bp): Remove. (bitpack_delete): Likewise. (bitpack_create): Likewise. (bp_get_next_word): Likewise. (bp_pack_value, bp_unpack_value): Move ... * lto-streamer.h (bp_pack_value, bp_unpack_value): ... here. Re-implement. (struct bitpack_d): Likewise. (bitpack_create, lto_output_bitpack, lto_input_bitpack): New inline functions. * lto-streamer-out.c (lto_output_bitpack): Remove. (pack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (pack_value_fields): Adjust. (lto_write_tree): Likewise. (output_gimple_stmt): Likewise. (output_function): Likewise. * lto-streamer-in.c (input_gimple_stmt): Adjust. (input_function): Likewise. (unpack_ts_base_value_fields): Adjust. Avoid conditional bitpacking. (lto_input_bitpack): Remove. (lto_materialize_tree): Adjust. * Makefile.in (ipa-prop.o): Add $(LTO_STREAMER_H) dependency. * lto-cgraph.c (lto_output_edge): Adjust. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (lto_output_ref): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_ref): Likewise. (input_edge): Likewise. (output_node_opt_summary): Likewise. (input_node_opt_summary): Likewise. * ipa-pure-const.c (pure_const_write_summary): Likewise. (pure_const_read_summary): Likewise. * ipa-prop.c (ipa_write_indirect_edge_info): Likewise. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Likewise. (ipa_read_node_info): Likewise. From-SVN: r160760
2010-06-14 20:54:17 +02:00
struct bitpack_d bp;
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_alloc_node_params (node, streamer_read_uhwi (ib));
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
for (k = 0; k < ipa_get_param_count (info); k++)
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
(*info->descriptors)[k].move_cost = streamer_read_uhwi (ib);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
bp = streamer_read_bitpack (ib);
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
if (ipa_get_param_count (info) != 0)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
info->analysis_done = true;
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
info->node_enqueued = false;
for (k = 0; k < ipa_get_param_count (info); k++)
ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. 2011-07-18 Martin Jambor <mjambor@suse.cz> * ipa-prop.h: Include alloc-pool.h, all sorts of updates to general comments. (ipcp_values_pool): Declare. (ipcp_sources_pool): Likewise. (ipcp_lattice): Changed to forward declaration. (ipa_param_descriptor): Removed fields ipcp_lattice, types and cannot_devirtualize. (ipa_node_params): New fields descriptors, lattices, known_vals, clone_for_all_contexts and node dead, removed fields params and count_scale. (ipa_set_param_count): Removed. (ipa_get_param_count): Made to work with descriptors vector. (ipa_get_param): Updated. (ipa_param_cannot_devirtualize_p): Removed. (ipa_param_types_vec_empty): Likewise. (ipa_set_param_used): New function. (ipa_get_param_used): Updated to use descriptors vector. (ipa_func_list): Removed. (ipa_init_func_list): Removed declaration. (ipa_push_func_to_list_1): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_push_func_to_list): Removed. (ipa_lattice_from_jfunc): Remove declaration. (ipa_get_jf_pass_through_result): Declare. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_get_lattice): Update. (ipa_lat_is_single_const): New function. * ipa-prop.c (ipa_push_func_to_list_1): Removed. (ipa_init_func_list): Likewise. (ipa_pop_func_from_list): Likewise. (ipa_get_param_decl_index): Fix coding style. (count_formal_params): Removed. (count_formal_params_1): Renamed to count_formal_params. (ipa_populate_param_decls): Update to use descriptors vector. (ipa_initialize_node_params): Likewise. (visit_ref_for_mod_analysis): Use ipa_set_param_used. (ipa_analyze_params_uses): Likewise. (ipa_free_node_params_substructures): Likewise and free also lattices and known values. (duplicate_array): Removed. (ipa_edge_duplication_hook): Add the new edge to the list of edge clones. (ipa_node_duplication_hook): Update to use new lattices. (ipa_free_all_structures_after_ipa_cp): Free alloc pools. (ipa_free_all_structures_after_iinln): Likewise. (ipa_write_node_info): Update to use new lattices. (ipa_read_node_info): Likewise. (ipa_get_jf_pass_through_result): New function. (ipa_get_jf_ancestor_result): Likewise. (ipa_value_from_jfunc): Likewise. (ipa_cst_from_jfunc): Reimplemented using ipa_value_from_jfunc. * ipa-cp.c: Reimplemented. * params.def (PARAM_DEVIRT_TYPE_LIST_SIZE): Removed. (PARAM_IPA_CP_VALUE_LIST_SIZE): New parameter. (PARAM_IPA_CP_EVAL_THRESHOLD): Likewise. * Makefile.in (IPA_PROP_H): Added alloc-pool.h to dependencies. * doc/invoke.texi (devirt-type-list-size): Removed description. (ipa-cp-value-list-size): Added description. * testsuite/gcc.dg/ipa/ipa-1.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-2.c: Likewise. * testsuite/gcc.dg/ipa/ipa-3.c: Likewise and made functions static. * testsuite/gcc.dg/ipa/ipa-4.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipa-5.c: Likewise. * testsuite/gcc.dg/ipa/ipa-7.c: Likewise. * testsuite/gcc.dg/ipa/ipa-8.c: Updated testcase dump scan. * testsuite/gcc.dg/ipa/ipacost-1.c: Likewise. * testsuite/gcc.dg/ipa/ipacost-2.c: Likewise and increased sizes of some functions. * testsuite/gcc.dg/ipa/ipcp-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-2.c: Likewise. * testsuite/gcc.dg/tree-ssa/ipa-cp-1.c: Updated testcase. From-SVN: r176424
2011-07-19 00:03:39 +02:00
ipa_set_param_used (info, k, bp_unpack_value (&bp, 1));
for (k = 0; k < ipa_get_param_count (info); k++)
{
ipa_set_controlled_uses (info, k, streamer_read_hwi (ib));
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
(*info->descriptors)[k].decl_or_type = stream_read_tree (ib, data_in);
}
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
for (e = node->callees; e; e = e->next_callee)
{
struct ipa_edge_args *args = IPA_EDGE_REF (e);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
int count = streamer_read_uhwi (ib);
bool contexts_computed = count & 1;
count /= 2;
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
if (!count)
continue;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_grow_cleared (args->jump_functions, count);
if (contexts_computed)
vec_safe_grow_cleared (args->polymorphic_call_contexts, count);
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
for (k = 0; k < ipa_get_cs_argument_count (args); k++)
{
ipa_read_jump_function (ib, ipa_get_ith_jump_func (args, k), e,
data_in);
if (contexts_computed)
ipa_get_ith_polymorhic_call_context (args, k)->stream_in (ib, data_in);
}
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
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
for (e = node->indirect_calls; e; e = e->next_callee)
{
struct ipa_edge_args *args = IPA_EDGE_REF (e);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
int count = streamer_read_uhwi (ib);
bool contexts_computed = count & 1;
count /= 2;
if (count)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec_safe_grow_cleared (args->jump_functions, count);
if (contexts_computed)
vec_safe_grow_cleared (args->polymorphic_call_contexts, count);
for (k = 0; k < ipa_get_cs_argument_count (args); k++)
{
ipa_read_jump_function (ib, ipa_get_ith_jump_func (args, k), e,
data_in);
if (contexts_computed)
ipa_get_ith_polymorhic_call_context (args, k)->stream_in (ib, data_in);
}
}
ipa_read_indirect_edge_info (ib, data_in, e);
}
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
}
/* Write jump functions for nodes in SET. */
void
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
ipa_prop_write_jump_functions (void)
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
{
struct cgraph_node *node;
struct output_block *ob;
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
unsigned int count = 0;
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
lto_symtab_encoder_iterator lsei;
lto_symtab_encoder_t encoder;
if (!ipa_node_params_sum || !ipa_edge_args_vector)
return;
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
ob = create_output_block (LTO_section_jump_functions);
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
encoder = ob->decl_state->symtab_node_encoder;
vapool.c: Include tree-ssa-alias.h, gimple.h and lto-streamer.h * vapool.c: Include tree-ssa-alias.h, gimple.h and lto-streamer.h (varpool_get_constructor): New function. (varpool_ctor_useable_for_folding_p): Break out from ... (ctor_for_folding): ... here; use varpool_get_constructor. (varpool_assemble_decl): Likewise. * lto-streamer.h (struct output_block): Turn cgraph_node to symbol filed. (lto_input_variable_constructor): Declare. * ipa-visibility.c (function_and_variable_visibility): Use varpool_get_constructor. * cgraph.h (varpool_get_constructor): Declare. (varpool_ctor_useable_for_folding_p): New function. * lto-streamer-out.c (get_symbol_initial_value): Take encoder parameter; return error_mark_node for non-trivial constructors. (lto_write_tree_1, DFS_write_tree): UPdate use of get_symbol_initial_value. (output_function): Update initialization of symbol. (output_constructor): New function. (copy_function): Rename to .. (copy_function_or_variable): ... this one; handle vars too. (lto_output): Output variable sections. * lto-streamer-in.c (input_constructor): New function. (lto_read_body): Rename from ... (lto_read_body_or_constructor): ... this one; handle vars too. (lto_input_variable_constructor): New function. * ipa-prop.c (ipa_prop_write_jump_functions, ipa_prop_write_all_agg_replacement): Update. * lto-cgraph.c (compute_ltrans_boundary): Use it. (output_cgraph_opt_summary): Set symbol to NULL. * lto-partition.c (add_references_to_partition): Use varpool_ctor_useable_for_folding_p. * lto.c (lto_read_in_decl_state): Update sanity check. From-SVN: r212467
2014-07-11 19:43:44 +02:00
ob->symbol = NULL;
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_function_in_partition (&lsei))
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
{
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
node = lsei_cgraph_node (lsei);
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
if (node->has_gimple_body_p ()
cgraph.c (cgraph_add_thunk): Create real function node instead of alias node... * cgraph.c (cgraph_add_thunk): Create real function node instead of alias node; finalize it and mark needed/reachale; arrange visibility to be right and add it into the corresponding same comdat group list. (dump_cgraph_node): Dump thunks. * cgraph.h (cgraph_first_defined_function, cgraph_next_defined_function, cgraph_function_with_gimple_body_p, cgraph_first_function_with_gimple_body, cgraph_next_function_with_gimple_body): New functions. (FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, FOR_EACH_DEFINED_FUNCTION): New macros. * ipa-cp.c (ipcp_need_redirect_p): Thunks can't be redirected. (ipcp_generate_summary): Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. * cgraphunit.c (cgraph_finalize_function): Only look into possible devirtualization when optimizing. (verify_cgraph_node): Verify thunks. (cgraph_analyze_function): Analyze thunks. (cgraph_mark_functions_to_output): Output thunks only in combination with function they are assigned to. (assemble_thunk): Turn thunk into non-thunk; don't try to turn alias into normal node. (assemble_thunks): New functoin. (cgraph_expand_function): Use it. * lto-cgraph.c (lto_output_node): Stream thunks. (input_overwrite_node): Stream in thunks. * ipa-pure-const.c (analyze_function): Thunks do nothing interesting. * lto-streamer-out.c (lto_output): Do not try to output thunk's body. * ipa-inline.c (inline_small_functions): Use FOR_EACH_DEFINED_FUNCTION. * ipa-inline-analysis.c (compute_inline_parameters): "Analyze" thunks. (inline_analyze_function): Do not care about thunk jump functions. (inline_generate_summary):Use FOR_EACH_DEFINED_FUNCTION. * ipa-prop.c (ipa_prop_write_jump_functions): Use cgraph_function_with_gimple_body_p. * passes.c (do_per_function_toporder): Use cgraph_function_with_gimple_body_p. (execute_one_pass);Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. (ipa_write_summaries): Use cgraph_function_with_gimple_body_p. (function_called_by_processed_nodes_p): Likewise. * lto.c (lto_materialize_function): Use cgraph_function_with_gimple_body_p. (add_cgraph_node_to_partition): Do not re-add items to partition; handle thunks. (add_varpool_node_to_partition): Do not re-add items to partition. From-SVN: r173517
2011-05-07 01:00:49 +02:00
&& IPA_NODE_REF (node) != NULL)
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
count++;
}
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_uhwi (ob, count);
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
/* Process all of the functions. */
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_function_in_partition (&lsei))
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
{
tree-pass.h (write_summary, [...]): Remove set and vset arguments. * tree-pass.h (write_summary, write_optimization_summary): Remove set and vset arguments. * ipa-cp.c (ipcp_write_summary): Remove set and vset arugments. (write_node_summary_p): Likewise; use the encoder. (ipa_reference_write_optimization_summary): Likewise. * lto-cgraph.c (output_cgraph_opt_summary): Use encoder. (lto_symtab_encoder_new): Initialize in_partition field. (lto_symtab_encoder_delete): Destroy in_partition field. (LCC_NOT_FOUND): Move to lto-streamer.h (lto_symtab_encoder_deref): Likewise. (lto_symtab_encoder_in_partition_p, lto_set_symtab_encoder_in_partition): New functions. (referenced_from_other_partition_p): Rewrite to use encoder. (reachable_from_other_partition_p): Likewise. (referenced_from_this_partition_p): Likewise. (reachable_from_this_partition_p): Likewise. (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_refs): Likewise. (compute_ltrans_boundary): Initialize in_partition fileds of the encoder. (output_symtab): Likewise. (input_refs): Match the changes in output_refs. (output_cgraph_opt_summary_p): Remove set argument. (output_node_opt_summary): Replace set by encoder. (output_cgraph_opt_summary): Remove set argument; use the encoder. * ipa-pure-const.c (pure_const_write_summary): Remove set and vset arguments; use the encoder. * lto-streamer-out.c (lto_output): Remove set and vset argument; use the encoder. (produce_symtab): Likewise. * ipa-inline.h (inline_write_summary): Remove set and vset arguments. * ipa-inline-analysis.c (inline_write_summary): Likewise. * ipa-prop.c (ipa_prop_write_jump_functions): Remove set argument; use encoder. * ipa-prop.h (ipa_prop_write_jump_functions): Likewise. * passes.c (ipa_write_summaries_2): Remove set and vset arguments. (ipa_write_summaries_1): Update. (ipa_write_optimization_summaries_1): Likewise. (ipa_write_optimization_summaries): Likewise. * lto-streamer.h (lto_symtab_encoder_t): Add in_partition. (lto_symtab_encoder_iterator): New type. (lto_symtab_encoder_deref): Make inline. (output_symtab, referenced_from_other_partition_p, reachable_from_other_partition_p, referenced_from_this_partition_p, reachable_from_this_partition_p): Update. (lsei_end_p, lsei_next, lsei_node, lsei_cgraph_node, lsei_varpool_node): New inline functions. (LCC_NOT_FOUND): New macro. (lto_symtab_encoder_deref, lsei_start, lsei_next_in_partition, lsei_start_in_partition, lsei_next_function_in_partition, lsei_start_function_in_partition, lsei_next_variable_in_partition, lsei_start_variable_in_partition): New inline functions. * lto-partition.c (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p, set_referenced_from_this_partition_p): New functions. (lto_promote_cross_file_statics): Use them. From-SVN: r190336
2012-08-13 04:37:51 +02:00
node = lsei_cgraph_node (lsei);
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
if (node->has_gimple_body_p ()
cgraph.c (cgraph_add_thunk): Create real function node instead of alias node... * cgraph.c (cgraph_add_thunk): Create real function node instead of alias node; finalize it and mark needed/reachale; arrange visibility to be right and add it into the corresponding same comdat group list. (dump_cgraph_node): Dump thunks. * cgraph.h (cgraph_first_defined_function, cgraph_next_defined_function, cgraph_function_with_gimple_body_p, cgraph_first_function_with_gimple_body, cgraph_next_function_with_gimple_body): New functions. (FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, FOR_EACH_DEFINED_FUNCTION): New macros. * ipa-cp.c (ipcp_need_redirect_p): Thunks can't be redirected. (ipcp_generate_summary): Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. * cgraphunit.c (cgraph_finalize_function): Only look into possible devirtualization when optimizing. (verify_cgraph_node): Verify thunks. (cgraph_analyze_function): Analyze thunks. (cgraph_mark_functions_to_output): Output thunks only in combination with function they are assigned to. (assemble_thunk): Turn thunk into non-thunk; don't try to turn alias into normal node. (assemble_thunks): New functoin. (cgraph_expand_function): Use it. * lto-cgraph.c (lto_output_node): Stream thunks. (input_overwrite_node): Stream in thunks. * ipa-pure-const.c (analyze_function): Thunks do nothing interesting. * lto-streamer-out.c (lto_output): Do not try to output thunk's body. * ipa-inline.c (inline_small_functions): Use FOR_EACH_DEFINED_FUNCTION. * ipa-inline-analysis.c (compute_inline_parameters): "Analyze" thunks. (inline_analyze_function): Do not care about thunk jump functions. (inline_generate_summary):Use FOR_EACH_DEFINED_FUNCTION. * ipa-prop.c (ipa_prop_write_jump_functions): Use cgraph_function_with_gimple_body_p. * passes.c (do_per_function_toporder): Use cgraph_function_with_gimple_body_p. (execute_one_pass);Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. (ipa_write_summaries): Use cgraph_function_with_gimple_body_p. (function_called_by_processed_nodes_p): Likewise. * lto.c (lto_materialize_function): Use cgraph_function_with_gimple_body_p. (add_cgraph_node_to_partition): Do not re-add items to partition; handle thunks. (add_varpool_node_to_partition): Do not re-add items to partition. From-SVN: r173517
2011-05-07 01:00:49 +02:00
&& IPA_NODE_REF (node) != NULL)
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_write_node_info (ob, node);
}
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
streamer_write_char_stream (ob->main_stream, 0);
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
produce_asm (ob, NULL);
destroy_output_block (ob);
}
/* Read section in file FILE_DATA of length LEN with data DATA. */
static void
ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data,
size_t len)
{
const struct lto_function_header *header =
(const struct lto_function_header *) data;
const int cfg_offset = sizeof (struct lto_function_header);
const int main_offset = cfg_offset + header->cfg_size;
const int string_offset = main_offset + header->main_size;
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
struct data_in *data_in;
unsigned int i;
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset,
passes.c (ipa_write_summaries_1): Call lto_output_init_mode_table. * passes.c (ipa_write_summaries_1): Call lto_output_init_mode_table. (ipa_write_optimization_summaries): Likewise. * tree-streamer.h: Include data-streamer.h. (streamer_mode_table): Declare extern variable. (bp_pack_machine_mode, bp_unpack_machine_mode): New inline functions. * lto-streamer-out.c (lto_output_init_mode_table, lto_write_mode_table): New functions. (produce_asm_for_decls): Call lto_write_mode_table when streaming offloading LTO. * lto-section-in.c (lto_section_name): Add "mode_table" entry. (lto_create_simple_input_block): Add mode_table argument to the lto_input_block constructors. * ipa-prop.c (ipa_prop_read_section, read_replacements_section): Likewise. * data-streamer-in.c (string_for_index): Likewise. * ipa-inline-analysis.c (inline_read_section): Likewise. * ipa-icf.c (sem_item_optimizer::read_section): Likewise. * lto-cgraph.c (input_cgraph_opt_section): Likewise. * lto-streamer-in.c (lto_read_body_or_constructor, lto_input_toplevel_asms): Likewise. (lto_input_mode_table): New function. * tree-streamer-out.c (pack_ts_fixed_cst_value_fields, pack_ts_decl_common_value_fields, pack_ts_type_common_value_fields): Use bp_pack_machine_mode. * real.h (struct real_format): Add name field. * lto-streamer.h (enum lto_section_type): Add LTO_section_mode_table. (class lto_input_block): Add mode_table member. (lto_input_block::lto_input_block): Add mode_table_ argument, initialize mode_table. (struct lto_file_decl_data): Add mode_table field. (lto_input_mode_table, lto_output_init_mode_table): New prototypes. * tree-streamer-in.c (unpack_ts_fixed_cst_value_fields, unpack_ts_decl_common_value_fields, unpack_ts_type_common_value_fields): Call bp_unpack_machine_mode. * tree-streamer.c (streamer_mode_table): New variable. * real.c (ieee_single_format, mips_single_format, motorola_single_format, spu_single_format, ieee_double_format, mips_double_format, motorola_double_format, ieee_extended_motorola_format, ieee_extended_intel_96_format, ieee_extended_intel_128_format, ieee_extended_intel_96_round_53_format, ibm_extended_format, mips_extended_format, ieee_quad_format, mips_quad_format, vax_f_format, vax_d_format, vax_g_format, decimal_single_format, decimal_double_format, decimal_quad_format, ieee_half_format, arm_half_format, real_internal_format): Add name field. * config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise. lto/ * lto.c (lto_mode_identity_table): New variable. (lto_read_decls): Add mode_table argument to the lto_input_block constructor. (lto_file_finalize): Initialize mode_table. (lto_init): Initialize lto_mode_identity_table. From-SVN: r221005
2015-02-26 13:26:11 +01:00
header->main_size, file_data->mode_table);
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
data_in =
lto_data_in_create (file_data, (const char *) data + string_offset,
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
header->string_size, vNULL);
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
count = streamer_read_uhwi (&ib_main);
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
for (i = 0; i < count; i++)
{
unsigned int index;
struct cgraph_node *node;
cgraph.h (vector types for symtab_node): Add. * cgraph.h (vector types for symtab_node): Add. * ipa-reference.c (ipa_reference_write_optimization_summary): Update for new symtab encoder. (ipa_reference_read_optimization_summary): Likewise. * lto-cgraph.c (output_varpool): Remove. (input_cgraph_opt_summary): Take symtab nodes vector as argument. (LTO_cgraph_tags): Rename to ... (LTO_symtab_tags): ... this one; add LTO_symtab_variable. (lto_cgraph_encoder_new): Rename to ... (lto_symtab_encoder_new): ... this on. (lto_cgraph_encoder_encode): Rename to ... (lto_symtab_encoder_encode): ... this one. (lto_cgraph_encoder_delete): Rename to ... (lto_symtab_encoder_delete): ... this one. (lto_cgraph_encoder_deref): Rename to ... (lto_symtab_encoder_deref): ... this one. (lto_cgraph_encoder_encode_body_p): Rename to ... (lto_symtab_encoder_encode_body_p): ... this one. (lto_varpool_encoder_new, lto_varpool_encoder_delete, lto_varpool_encoder_encode, lto_varpool_encoder_lookup, lto_varpool_encoder_deref): Remove. (lto_varpool_encoder_encode_initializer_p): Rename to ... (lto_symtab_encoder_encode_initializer_p): ... this one. (lto_set_varpool_encoder_encode_initializer): Rename to ... (lto_set_symtab_encoder_encode_initializer): ... this one. (lto_output_edge): Update. (lto_output_node): Update. (lto_output_varpool_node): Update; stream out LTO_symtab_variable tag. (lto_output_ref): Drop varpool_encoder; update. (add_node_to): Update. (add_references): Update. (output_outgoing_cgraph_edges): Update. (output_refs): Update. (compute_ltrans_boundary): Update. (output_cgraph): Update; output varpools too. (input_overwrite_node): Update. (output_varpool): Remove. (input_node): Update. (input_ref): Update. (input_edge): Update. (input_cgraph_1): Update; input varpool too; unify fixup code. (input_varpool_1): Remove. (input_refs): Update. (input_cgraph): Update. (output_node_opt_summary): Update. (input_cgraph_opt_section): Update. (input_cgraph_opt_summary): Update. * ipa-pure-const.c (pure_const_write_summary): Update. (pure_const_read_summary): Update. * lto-streamer-out.c (lto_write_tree): Update. (lto_output): Likewise. (produce_symtab): Update. (produce_asm_for_decls): Update. * ipa-inline-analysis.c (inline_read_section): Update. (inline_write_summary): Update. * ipa-prop.c (ipa_write_node_info): Update. (ipa_prop_read_section): Update. * lto-streamer.h (lto_cgraph_encoder_d): Rename to ... (lto_symtab_encoder_d): ... this one; add initializer. (lto_cgraph_encoder_t): Rename to ... (lto_symtab_encoder_t): ... this one. (lto_cgraph_encoder_size): Rename to ... (lto_symtab_encoder_size): ... this one. (lto_varpool_encoder_d): ... remove. (lto_varpool_encoder_t): Remove. (lto_out_decl_state): Remove cgraph_node_encoder, varpool_node_encoder add symtab_node_encoder. (lto_file_decl_data): Likewise. (lto_cgraph_encoder_deref, lto_cgraph_encoder_lookup, lto_cgraph_encoder_new, lto_cgraph_encoder_encode, lto_cgraph_encoder_delete, lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p, lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_new, lto_varpool_encoder_encode, lto_varpool_encoder_delete, lto_varpool_encoder_encode_initializer_p): Remove. (lto_symtab_encoder_deref, lto_symtab_encoder_lookup, lto_symtab_encoder_t, lto_symtab_encoder_encode, lto_symtab_encoder_delete, lto_symtab_encoder_encode_body_p, lto_symtab_encoder_encode_initializer_p): New. From-SVN: r190309
2012-08-11 05:04:35 +02:00
lto_symtab_encoder_t encoder;
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
data-streamer.h (streamer_write_zero): Rename from output_zero. * data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-12 18:42:13 +02:00
index = streamer_read_uhwi (&ib_main);
cgraph.h (vector types for symtab_node): Add. * cgraph.h (vector types for symtab_node): Add. * ipa-reference.c (ipa_reference_write_optimization_summary): Update for new symtab encoder. (ipa_reference_read_optimization_summary): Likewise. * lto-cgraph.c (output_varpool): Remove. (input_cgraph_opt_summary): Take symtab nodes vector as argument. (LTO_cgraph_tags): Rename to ... (LTO_symtab_tags): ... this one; add LTO_symtab_variable. (lto_cgraph_encoder_new): Rename to ... (lto_symtab_encoder_new): ... this on. (lto_cgraph_encoder_encode): Rename to ... (lto_symtab_encoder_encode): ... this one. (lto_cgraph_encoder_delete): Rename to ... (lto_symtab_encoder_delete): ... this one. (lto_cgraph_encoder_deref): Rename to ... (lto_symtab_encoder_deref): ... this one. (lto_cgraph_encoder_encode_body_p): Rename to ... (lto_symtab_encoder_encode_body_p): ... this one. (lto_varpool_encoder_new, lto_varpool_encoder_delete, lto_varpool_encoder_encode, lto_varpool_encoder_lookup, lto_varpool_encoder_deref): Remove. (lto_varpool_encoder_encode_initializer_p): Rename to ... (lto_symtab_encoder_encode_initializer_p): ... this one. (lto_set_varpool_encoder_encode_initializer): Rename to ... (lto_set_symtab_encoder_encode_initializer): ... this one. (lto_output_edge): Update. (lto_output_node): Update. (lto_output_varpool_node): Update; stream out LTO_symtab_variable tag. (lto_output_ref): Drop varpool_encoder; update. (add_node_to): Update. (add_references): Update. (output_outgoing_cgraph_edges): Update. (output_refs): Update. (compute_ltrans_boundary): Update. (output_cgraph): Update; output varpools too. (input_overwrite_node): Update. (output_varpool): Remove. (input_node): Update. (input_ref): Update. (input_edge): Update. (input_cgraph_1): Update; input varpool too; unify fixup code. (input_varpool_1): Remove. (input_refs): Update. (input_cgraph): Update. (output_node_opt_summary): Update. (input_cgraph_opt_section): Update. (input_cgraph_opt_summary): Update. * ipa-pure-const.c (pure_const_write_summary): Update. (pure_const_read_summary): Update. * lto-streamer-out.c (lto_write_tree): Update. (lto_output): Likewise. (produce_symtab): Update. (produce_asm_for_decls): Update. * ipa-inline-analysis.c (inline_read_section): Update. (inline_write_summary): Update. * ipa-prop.c (ipa_write_node_info): Update. (ipa_prop_read_section): Update. * lto-streamer.h (lto_cgraph_encoder_d): Rename to ... (lto_symtab_encoder_d): ... this one; add initializer. (lto_cgraph_encoder_t): Rename to ... (lto_symtab_encoder_t): ... this one. (lto_cgraph_encoder_size): Rename to ... (lto_symtab_encoder_size): ... this one. (lto_varpool_encoder_d): ... remove. (lto_varpool_encoder_t): Remove. (lto_out_decl_state): Remove cgraph_node_encoder, varpool_node_encoder add symtab_node_encoder. (lto_file_decl_data): Likewise. (lto_cgraph_encoder_deref, lto_cgraph_encoder_lookup, lto_cgraph_encoder_new, lto_cgraph_encoder_encode, lto_cgraph_encoder_delete, lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p, lto_varpool_encoder_deref, lto_varpool_encoder_lookup, lto_varpool_encoder_new, lto_varpool_encoder_encode, lto_varpool_encoder_delete, lto_varpool_encoder_encode_initializer_p): Remove. (lto_symtab_encoder_deref, lto_symtab_encoder_lookup, lto_symtab_encoder_t, lto_symtab_encoder_encode, lto_symtab_encoder_delete, lto_symtab_encoder_encode_body_p, lto_symtab_encoder_encode_initializer_p): New. From-SVN: r190309
2012-08-11 05:04:35 +02:00
encoder = file_data->symtab_node_encoder;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
node = dyn_cast<cgraph_node *> (lto_symtab_encoder_deref (encoder,
index));
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
gcc_assert (node->definition);
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_read_node_info (&ib_main, node, data_in);
}
lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
len);
lto_data_in_delete (data_in);
}
/* Read ipcp jump functions. */
void
ipa_prop_read_jump_functions (void)
{
struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
struct lto_file_decl_data *file_data;
unsigned int j = 0;
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
ipa_register_cgraph_hooks ();
while ((file_data = file_data_vec[j++]))
{
size_t len;
const char *data = lto_get_section_data (file_data, LTO_section_jump_functions, NULL, &len);
if (data)
ipa_prop_read_section (file_data, data, len);
}
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* After merging units, we can get mismatch in argument counts.
Also decl merging might've rendered parameter lists obsolete.
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
Also compute called_with_variable_arg info. */
void
ipa_update_after_lto_read (void)
{
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
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
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
void
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
write_ipcp_transformation_info (output_block *ob, cgraph_node *node)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
{
int node_ref;
unsigned int count = 0;
lto_symtab_encoder_t encoder;
struct ipa_agg_replacement_value *aggvals, *av;
aggvals = ipa_get_agg_replacements_for_node (node);
encoder = ob->decl_state->symtab_node_encoder;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
node_ref = lto_symtab_encoder_encode (encoder, node);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
streamer_write_uhwi (ob, node_ref);
for (av = aggvals; av; av = av->next)
count++;
streamer_write_uhwi (ob, count);
for (av = aggvals; av; av = av->next)
{
struct bitpack_d bp;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
streamer_write_uhwi (ob, av->offset);
streamer_write_uhwi (ob, av->index);
stream_write_tree (ob, av->value, true);
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, av->by_ref, 1);
streamer_write_bitpack (&bp);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
if (ts && vec_safe_length (ts->m_vr) > 0)
{
count = ts->m_vr->length ();
streamer_write_uhwi (ob, count);
for (unsigned i = 0; i < count; ++i)
{
struct bitpack_d bp;
ipa_vr *parm_vr = &(*ts->m_vr)[i];
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, parm_vr->known, 1);
streamer_write_bitpack (&bp);
if (parm_vr->known)
{
streamer_write_enum (ob->main_stream, value_rang_type,
VR_LAST, parm_vr->type);
streamer_write_wide_int (ob, parm_vr->min);
streamer_write_wide_int (ob, parm_vr->max);
}
}
}
else
streamer_write_uhwi (ob, 0);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
if (ts && vec_safe_length (ts->bits) > 0)
{
count = ts->bits->length ();
streamer_write_uhwi (ob, count);
for (unsigned i = 0; i < count; ++i)
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
const ipa_bits *bits_jfunc = (*ts->bits)[i];
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
struct bitpack_d bp = bitpack_create (ob->main_stream);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
bp_pack_value (&bp, !!bits_jfunc, 1);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
streamer_write_bitpack (&bp);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (bits_jfunc)
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
streamer_write_widest_int (ob, bits_jfunc->value);
streamer_write_widest_int (ob, bits_jfunc->mask);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
}
}
}
else
streamer_write_uhwi (ob, 0);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
/* Stream in the aggregate value replacement chain for NODE from IB. */
static void
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
read_ipcp_transformation_info (lto_input_block *ib, cgraph_node *node,
data_in *data_in)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
{
struct ipa_agg_replacement_value *aggvals = NULL;
unsigned int count, i;
count = streamer_read_uhwi (ib);
for (i = 0; i <count; i++)
{
struct ipa_agg_replacement_value *av;
struct bitpack_d bp;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
av = ggc_alloc<ipa_agg_replacement_value> ();
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
av->offset = streamer_read_uhwi (ib);
av->index = streamer_read_uhwi (ib);
av->value = stream_read_tree (ib, data_in);
bp = streamer_read_bitpack (ib);
av->by_ref = bp_unpack_value (&bp, 1);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
av->next = aggvals;
aggvals = av;
}
ipa_set_node_agg_value_chain (node, aggvals);
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
count = streamer_read_uhwi (ib);
if (count > 0)
{
ipcp_grow_transformations_if_necessary ();
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
vec_safe_grow_cleared (ts->m_vr, count);
for (i = 0; i < count; i++)
{
ipa_vr *parm_vr;
parm_vr = &(*ts->m_vr)[i];
struct bitpack_d bp;
bp = streamer_read_bitpack (ib);
parm_vr->known = bp_unpack_value (&bp, 1);
if (parm_vr->known)
{
parm_vr->type = streamer_read_enum (ib, value_range_type,
VR_LAST);
parm_vr->min = streamer_read_wide_int (ib);
parm_vr->max = streamer_read_wide_int (ib);
}
}
}
count = streamer_read_uhwi (ib);
if (count > 0)
{
ipcp_grow_transformations_if_necessary ();
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
vec_safe_grow_cleared (ts->bits, count);
for (i = 0; i < count; i++)
{
struct bitpack_d bp = streamer_read_bitpack (ib);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
bool known = bp_unpack_value (&bp, 1);
if (known)
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
ipa_bits *bits
= ipa_get_ipa_bits_for_value (streamer_read_widest_int (ib),
streamer_read_widest_int (ib));
(*ts->bits)[i] = bits;
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
}
}
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
/* Write all aggregate replacement for nodes in set. */
void
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipcp_write_transformation_summaries (void)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
{
struct cgraph_node *node;
struct output_block *ob;
unsigned int count = 0;
lto_symtab_encoder_iterator lsei;
lto_symtab_encoder_t encoder;
ob = create_output_block (LTO_section_ipcp_transform);
encoder = ob->decl_state->symtab_node_encoder;
vapool.c: Include tree-ssa-alias.h, gimple.h and lto-streamer.h * vapool.c: Include tree-ssa-alias.h, gimple.h and lto-streamer.h (varpool_get_constructor): New function. (varpool_ctor_useable_for_folding_p): Break out from ... (ctor_for_folding): ... here; use varpool_get_constructor. (varpool_assemble_decl): Likewise. * lto-streamer.h (struct output_block): Turn cgraph_node to symbol filed. (lto_input_variable_constructor): Declare. * ipa-visibility.c (function_and_variable_visibility): Use varpool_get_constructor. * cgraph.h (varpool_get_constructor): Declare. (varpool_ctor_useable_for_folding_p): New function. * lto-streamer-out.c (get_symbol_initial_value): Take encoder parameter; return error_mark_node for non-trivial constructors. (lto_write_tree_1, DFS_write_tree): UPdate use of get_symbol_initial_value. (output_function): Update initialization of symbol. (output_constructor): New function. (copy_function): Rename to .. (copy_function_or_variable): ... this one; handle vars too. (lto_output): Output variable sections. * lto-streamer-in.c (input_constructor): New function. (lto_read_body): Rename from ... (lto_read_body_or_constructor): ... this one; handle vars too. (lto_input_variable_constructor): New function. * ipa-prop.c (ipa_prop_write_jump_functions, ipa_prop_write_all_agg_replacement): Update. * lto-cgraph.c (compute_ltrans_boundary): Use it. (output_cgraph_opt_summary): Set symbol to NULL. * lto-partition.c (add_references_to_partition): Use varpool_ctor_useable_for_folding_p. * lto.c (lto_read_in_decl_state): Update sanity check. From-SVN: r212467
2014-07-11 19:43:44 +02:00
ob->symbol = NULL;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_function_in_partition (&lsei))
{
node = lsei_cgraph_node (lsei);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
if (node->has_gimple_body_p ())
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
count++;
}
streamer_write_uhwi (ob, count);
for (lsei = lsei_start_function_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_function_in_partition (&lsei))
{
node = lsei_cgraph_node (lsei);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
if (node->has_gimple_body_p ())
write_ipcp_transformation_info (ob, node);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
streamer_write_char_stream (ob->main_stream, 0);
produce_asm (ob, NULL);
destroy_output_block (ob);
}
/* Read replacements section in file FILE_DATA of length LEN with data
DATA. */
static void
read_replacements_section (struct lto_file_decl_data *file_data,
const char *data,
size_t len)
{
const struct lto_function_header *header =
(const struct lto_function_header *) data;
const int cfg_offset = sizeof (struct lto_function_header);
const int main_offset = cfg_offset + header->cfg_size;
const int string_offset = main_offset + header->main_size;
struct data_in *data_in;
unsigned int i;
unsigned int count;
lto_input_block ib_main ((const char *) data + main_offset,
passes.c (ipa_write_summaries_1): Call lto_output_init_mode_table. * passes.c (ipa_write_summaries_1): Call lto_output_init_mode_table. (ipa_write_optimization_summaries): Likewise. * tree-streamer.h: Include data-streamer.h. (streamer_mode_table): Declare extern variable. (bp_pack_machine_mode, bp_unpack_machine_mode): New inline functions. * lto-streamer-out.c (lto_output_init_mode_table, lto_write_mode_table): New functions. (produce_asm_for_decls): Call lto_write_mode_table when streaming offloading LTO. * lto-section-in.c (lto_section_name): Add "mode_table" entry. (lto_create_simple_input_block): Add mode_table argument to the lto_input_block constructors. * ipa-prop.c (ipa_prop_read_section, read_replacements_section): Likewise. * data-streamer-in.c (string_for_index): Likewise. * ipa-inline-analysis.c (inline_read_section): Likewise. * ipa-icf.c (sem_item_optimizer::read_section): Likewise. * lto-cgraph.c (input_cgraph_opt_section): Likewise. * lto-streamer-in.c (lto_read_body_or_constructor, lto_input_toplevel_asms): Likewise. (lto_input_mode_table): New function. * tree-streamer-out.c (pack_ts_fixed_cst_value_fields, pack_ts_decl_common_value_fields, pack_ts_type_common_value_fields): Use bp_pack_machine_mode. * real.h (struct real_format): Add name field. * lto-streamer.h (enum lto_section_type): Add LTO_section_mode_table. (class lto_input_block): Add mode_table member. (lto_input_block::lto_input_block): Add mode_table_ argument, initialize mode_table. (struct lto_file_decl_data): Add mode_table field. (lto_input_mode_table, lto_output_init_mode_table): New prototypes. * tree-streamer-in.c (unpack_ts_fixed_cst_value_fields, unpack_ts_decl_common_value_fields, unpack_ts_type_common_value_fields): Call bp_unpack_machine_mode. * tree-streamer.c (streamer_mode_table): New variable. * real.c (ieee_single_format, mips_single_format, motorola_single_format, spu_single_format, ieee_double_format, mips_double_format, motorola_double_format, ieee_extended_motorola_format, ieee_extended_intel_96_format, ieee_extended_intel_128_format, ieee_extended_intel_96_round_53_format, ibm_extended_format, mips_extended_format, ieee_quad_format, mips_quad_format, vax_f_format, vax_d_format, vax_g_format, decimal_single_format, decimal_double_format, decimal_quad_format, ieee_half_format, arm_half_format, real_internal_format): Add name field. * config/pdp11/pdp11.c (pdp11_f_format, pdp11_d_format): Likewise. lto/ * lto.c (lto_mode_identity_table): New variable. (lto_read_decls): Add mode_table argument to the lto_input_block constructor. (lto_file_finalize): Initialize mode_table. (lto_init): Initialize lto_mode_identity_table. From-SVN: r221005
2015-02-26 13:26:11 +01:00
header->main_size, file_data->mode_table);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
data_in = lto_data_in_create (file_data, (const char *) data + string_offset,
Introduce vNULL to use as a nil initializer for vec<>. This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. 2012-11-20 Diego Novillo <dnovillo@google.com> Jakub Jelinek <jakub@redhat.com> ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec<T, A>() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec<T,A>() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec<T, A>() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec<T, A>() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec<T, A>() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec<T, A>() initializers with vNULL. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r193677
2012-11-20 22:21:30 +01:00
header->string_size, vNULL);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
count = streamer_read_uhwi (&ib_main);
for (i = 0; i < count; i++)
{
unsigned int index;
struct cgraph_node *node;
lto_symtab_encoder_t encoder;
index = streamer_read_uhwi (&ib_main);
encoder = file_data->symtab_node_encoder;
IPA C++ refactoring 1/N * cgraph.h (symtab_node): (void register_symbol (void)): created from symtab_register_node (void remove (void)): created from symtab_remove_node (void dump (FILE *f)): created from dump_symtab_node (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type)): created from add_reference (struct ipa_ref *add_reference (symtab_node *referred_node, enum ipa_ref_use use_type, gimple stmt)): created from add_reference (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type, gimple stmt)): created from maybe_add_reference (bool semantically_equivalent_p (symtab_node *target)): created from symtab_semantically_equivalent_p (void remove_from_same_comdat_group (void)): created from remove_from_same_comdat_group (void add_to_same_comdat_group (symtab_node *old_node)): created from symtab_add_to_same_comdat_group (void dissolve_same_comdat_group_list (void)): created from symtab_dissolve_same_comdat_group_list (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p (symtab_node *ultimate_alias_target (enum availability *avail = NULL)): created from symtab_alias_ultimate_target (inline symtab_node *next_defined_symbol (void)): created from symtab_next_defined_symbol (bool resolve_alias (symtab_node *target)): created from symtab_resolve_alias (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *), void *data, bool include_overwrite)): created from symtab_for_node_and_aliases (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias (inline symtab_node *get_alias_target (void)): created from symtab_alias_target (void set_section (const char *section)): created from set_section_1 (enum availability get_availability (void)): created from symtab_node_availability (void make_decl_local (void)): created from symtab_make_decl_local (bool real_symbol_p (void)): created from symtab_read_node (can_be_discarded_p (void)): created from symtab_can_be_discarded (inline bool comdat_local_p (void)): created from symtab_comdat_local_p (inline bool in_same_comdat_group_p (symtab_node *target)): created from symtab_in_same_comdat_p; (bool address_taken_from_non_vtable_p (void)): created from address_taken_from_non_vtable_p (static inline symtab_node *get (const_tree decl)): created from symtab_get_node (static void dump_table (FILE *)): created from dump_symtab (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab (static bool used_from_object_file_p_worker (symtab_node *node)): created from symtab_used_from_object_file_p (void dump_base (FILE *)): created from dump_symtab_base (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base (void unregister (void)): created from symtab_unregister_node (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section (static bool noninterposable_alias (symtab_node *node, void *data)): created from symtab_nonoverwritable_alias_1 * cgraph.h (cgraph_node): (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)): created from cgraph_remove_node_and_inline_clones (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt, bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones (cgraph_node *function_symbol (enum availability *avail = NULL)): created from cgraph_function_node (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original, vec<cgraph_edge *> redirect_callers, bool call_duplication_hook, struct cgraph_node *new_inlined_to, bitmap args_to_skip)): created from cgraph_create_clone (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)): created from cgraph_create_virtual_clone (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers, bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers, vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return, bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)): created from cgraph_function_version_info (struct cgraph_function_version_info *insert_new_function_version (void)): created from insert_new_cgraph_node_version (struct cgraph_function_version_info *function_version (void)): created from get_cgraph_node_version (void analyze (void)): created from analyze_function (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting, HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset, tree real_alias) cgraph_add_thunk (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target (cgraph_node *ultimate_alias_target (availability *availability = NULL)): created from cgraph_function_or_thunk_node (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)): created from expand_thunk (void reset (void)): created from cgraph_reset_node (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node (void remove (void)): created from cgraph_remove_node (void dump (FILE *f)): created from dump_cgraph_node (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node (bool get_body (void)): created from cgraph_get_body (void release_body (void)): created from cgraph_release_function_body (void unnest (void)): created from cgraph_unnest_node (void make_local (void)): created from cgraph_make_node_local (void mark_address_taken (void)): created from cgraph_mark_address_taken_node (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt, gcov_type count, int freq)): created from cgraph_create_edge (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags, gcov_type count, int freq)): created from cgraph_create_indirect_edge (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt, gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)): created from cgraph_create_edge_including_clones (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node (void remove_callers (void)): created from cgraph_node_remove_callers (void remove_callees (void)): created from cgraph_node_remove_callees (enum availability get_availability (void)): created from cgraph_function_body_availability (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag (void call_duplication_hooks (cgraph_node *node2)): created from cgraph_call_node_duplication_hooks (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *), void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data), void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases (void call_function_insertion_hooks (void)): created from cgraph_call_function_insertion_hooks (inline void mark_force_output (void)): created from cgraph_mark_force_output_node (bool local_p (void)): created from cgraph_local_node (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p (bool cannot_return_p (void)): created from cgraph_node_cannot_return (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p (inline bool only_called_directly_or_aliased_p (void)): created from cgraph_only_called_directly_or_aliased_p (bool will_be_removed_from_program_if_no_direct_calls_p (void)): created from cgraph_will_be_removed_from_program_if_no_direct_calls (bool can_remove_if_no_direct_calls_and_refs_p (void)): created from cgraph_can_remove_if_no_direct_calls_and_refs_p (bool can_remove_if_no_direct_calls_p (void)): created from cgraph_can_remove_if_no_direct_calls_p (inline bool has_gimple_body_p (void)): created from cgraph_function_with_gimple_body_p (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p (static void dump_cgraph (FILE *f)): created from dump_cgraph (static inline void debug_cgraph (void)): created from debug_cgraph (static void record_function_versions (tree decl1, tree decl2)): created from record_function_versions (static void delete_function_version (tree decl)): created from delete_function_version (static void add_new_function (tree fndecl, bool lowered)): created from cgraph_add_new_function (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node (static cgraph_node * create (tree decl)): created from cgraph_create_node (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node (static cgraph_node * get_create (tree)): created from cgraph_get_create_node (static cgraph_node *get_for_asmname (tree asmname)): created from cgraph_node_for_asm (static cgraph_node * create_same_body_alias (tree alias, tree decl)): created from cgraph_same_body_alias (static bool used_from_object_file_p_worker (cgraph_node *node, void *): new function (static bool non_local_p (cgraph_node *node, void *)): created from cgraph_non_local_node_p_1 (static void DEBUG_FUNCTION verify_cgraph_nodes (void)): created from verify_cgraph (static bool make_local (cgraph_node *node, void *)): created from cgraph_make_node_local (static cgraph_node *create_alias (tree alias, tree target)): created from cgraph_create_function_alias (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_create_edge_1 * cgraph.h (varpool_node): (void remove (void)): created from varpool_remove_node (void dump (FILE *f)): created from dump_varpool_node From-SVN: r212982
2014-07-24 14:07:13 +02:00
node = dyn_cast<cgraph_node *> (lto_symtab_encoder_deref (encoder,
index));
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
gcc_assert (node->definition);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
read_ipcp_transformation_info (&ib_main, node, data_in);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
}
lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
len);
lto_data_in_delete (data_in);
}
/* Read IPA-CP aggregate replacements. */
void
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
ipcp_read_transformation_summaries (void)
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
{
struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
struct lto_file_decl_data *file_data;
unsigned int j = 0;
while ((file_data = file_data_vec[j++]))
{
size_t len;
const char *data = lto_get_section_data (file_data,
LTO_section_ipcp_transform,
NULL, &len);
if (data)
read_replacements_section (file_data, data, len);
}
}
/* Adjust the aggregate replacements in AGGVAL to reflect parameters skipped in
NODE. */
static void
adjust_agg_replacement_values (struct cgraph_node *node,
struct ipa_agg_replacement_value *aggval)
{
struct ipa_agg_replacement_value *v;
int i, c = 0, d = 0, *adj;
if (!node->clone.combined_args_to_skip)
return;
for (v = aggval; v; v = v->next)
{
gcc_assert (v->index >= 0);
if (c < v->index)
c = v->index;
}
c++;
adj = XALLOCAVEC (int, c);
for (i = 0; i < c; i++)
if (bitmap_bit_p (node->clone.combined_args_to_skip, i))
{
adj[i] = -1;
d++;
}
else
adj[i] = i - d;
for (v = aggval; v; v = v->next)
v->index = adj[v->index];
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* Dominator walker driving the ipcp modification phase. */
class ipcp_modif_dom_walker : public dom_walker
{
public:
ipcp_modif_dom_walker (struct ipa_func_body_info *fbi,
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec<ipa_param_descriptor, va_gc> *descs,
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_agg_replacement_value *av,
bool *sc, bool *cc)
: dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors (descs),
m_aggval (av), m_something_changed (sc), m_cfg_changed (cc) {}
re PR tree-optimization/68619 (error: loop with header 6 not in loop tree) 2015-12-10 Jeff Law <law@redhat.com> PR tree-optimization/68619 * tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate return value from optimize_stmt. (dom_opt_dom_walker): Add new argument to dom_walker constructor. (pass_dominator:execute): If a block has an unreachable edge, remove all jump threads through any successor of the affected block. (record_equivalences_from_phis): Ignore alternative if the edge does not have EDGE_EXECUTABLE set. (single_incoming_edge_ignoring_loop_edges): Similarly. (optimize_stmt): If a gimple_code has a compile-time constant condition, return the edge taken for that constant value. Also change the condition to true/false as necessary. * domwalk.h (dom_walker::dom_walker): Add new argument skip_unreachable_blocks. Don't provide empty constructor body. (dom_walker::before_dom_children): Change return type. (dom_walker::bb_reachable): Declare new private method. (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::m_unreachable_dom): Declare new private data member. (dom_walker::m_skip_unreachable_blocks): Likewise. * domwalk.c: Include dumpfile.h. (dom_walker::dom_walker): New constructor. Initialize private data members. If needed, set EDGE_EXECUTABLE for all edges in the CFG, extracted from tree-ssa-sccvn.c. (dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::walk): Only call before_dom_children on reachable blocks. If before_dom_children returns an edge, then clear EDGE_EXECUTABLE for all other outgoing edges from the same block. For unreachable blocks, call propagate_unreachable_to_edges. Similarly, only call after_dom_children on reachable blocks. For unreachable blocks, conditionally clear m_unreachable_dom. * tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove private data member. (sccvn_dom_walker::after_dom_children): Use methods from dom_walker class. (run_scc_vn): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. Return the taken outgoing edge if a COND, SWITCH, or GOTO are optimized. * compare-elim.c (find_comparison_dom_walker::before_dom_children): Change return type to an edge. Always return NULL. * fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise. (rewrite_update_dom_walker::before_dom_children): Likewise. (mark_def_dom_children::before_dom_children): Likewise. * tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_dom_walker::before_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children): Likewise. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker::before_dom_children): Likewise. PR tree-optimization/68619 * gcc.dg/tree-ssa/pr68619-1.c: New test. * gcc.dg/tree-ssa/pr68619-2.c: New test. * gcc.dg/tree-ssa/pr68619-3.c: New test. * gcc.dg/tree-ssa/pr68619-4.c: New test. * gcc.dg/tree-ssa/pr68619-5.c: New test. From-SVN: r231527
2015-12-10 17:34:43 +01:00
virtual edge before_dom_children (basic_block);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
private:
struct ipa_func_body_info *m_fbi;
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec<ipa_param_descriptor, va_gc> *m_descriptors;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
struct ipa_agg_replacement_value *m_aggval;
bool *m_something_changed, *m_cfg_changed;
};
re PR tree-optimization/68619 (error: loop with header 6 not in loop tree) 2015-12-10 Jeff Law <law@redhat.com> PR tree-optimization/68619 * tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate return value from optimize_stmt. (dom_opt_dom_walker): Add new argument to dom_walker constructor. (pass_dominator:execute): If a block has an unreachable edge, remove all jump threads through any successor of the affected block. (record_equivalences_from_phis): Ignore alternative if the edge does not have EDGE_EXECUTABLE set. (single_incoming_edge_ignoring_loop_edges): Similarly. (optimize_stmt): If a gimple_code has a compile-time constant condition, return the edge taken for that constant value. Also change the condition to true/false as necessary. * domwalk.h (dom_walker::dom_walker): Add new argument skip_unreachable_blocks. Don't provide empty constructor body. (dom_walker::before_dom_children): Change return type. (dom_walker::bb_reachable): Declare new private method. (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::m_unreachable_dom): Declare new private data member. (dom_walker::m_skip_unreachable_blocks): Likewise. * domwalk.c: Include dumpfile.h. (dom_walker::dom_walker): New constructor. Initialize private data members. If needed, set EDGE_EXECUTABLE for all edges in the CFG, extracted from tree-ssa-sccvn.c. (dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::walk): Only call before_dom_children on reachable blocks. If before_dom_children returns an edge, then clear EDGE_EXECUTABLE for all other outgoing edges from the same block. For unreachable blocks, call propagate_unreachable_to_edges. Similarly, only call after_dom_children on reachable blocks. For unreachable blocks, conditionally clear m_unreachable_dom. * tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove private data member. (sccvn_dom_walker::after_dom_children): Use methods from dom_walker class. (run_scc_vn): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. Return the taken outgoing edge if a COND, SWITCH, or GOTO are optimized. * compare-elim.c (find_comparison_dom_walker::before_dom_children): Change return type to an edge. Always return NULL. * fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise. (rewrite_update_dom_walker::before_dom_children): Likewise. (mark_def_dom_children::before_dom_children): Likewise. * tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_dom_walker::before_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children): Likewise. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker::before_dom_children): Likewise. PR tree-optimization/68619 * gcc.dg/tree-ssa/pr68619-1.c: New test. * gcc.dg/tree-ssa/pr68619-2.c: New test. * gcc.dg/tree-ssa/pr68619-3.c: New test. * gcc.dg/tree-ssa/pr68619-4.c: New test. * gcc.dg/tree-ssa/pr68619-5.c: New test. From-SVN: r231527
2015-12-10 17:34:43 +01:00
edge
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
ipcp_modif_dom_walker::before_dom_children (basic_block bb)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
struct ipa_agg_replacement_value *v;
gimple *stmt = gsi_stmt (gsi);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
tree rhs, val, t;
HOST_WIDE_INT offset, size;
int index;
bool by_ref, vce;
if (!gimple_assign_load_p (stmt))
continue;
rhs = gimple_assign_rhs1 (stmt);
if (!is_gimple_reg_type (TREE_TYPE (rhs)))
continue;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
vce = false;
t = rhs;
while (handled_component_p (t))
{
/* V_C_E can do things like convert an array of integers to one
bigger integer and similar things we do not handle below. */
if (TREE_CODE (rhs) == VIEW_CONVERT_EXPR)
{
vce = true;
break;
}
t = TREE_OPERAND (t, 0);
}
if (vce)
continue;
if (!ipa_load_from_parm_agg (m_fbi, m_descriptors, stmt, rhs, &index,
&offset, &size, &by_ref))
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
continue;
for (v = m_aggval; v; v = v->next)
if (v->index == index
&& v->offset == offset)
break;
if (!v
|| v->by_ref != by_ref
|| tree_to_shwi (TYPE_SIZE (TREE_TYPE (v->value))) != size)
continue;
gcc_checking_assert (is_gimple_ip_invariant (v->value));
if (!useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (v->value)))
{
if (fold_convertible_p (TREE_TYPE (rhs), v->value))
val = fold_build1 (NOP_EXPR, TREE_TYPE (rhs), v->value);
else if (TYPE_SIZE (TREE_TYPE (rhs))
== TYPE_SIZE (TREE_TYPE (v->value)))
val = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (rhs), v->value);
else
{
if (dump_file)
{
fprintf (dump_file, " const ");
print_generic_expr (dump_file, v->value, 0);
fprintf (dump_file, " can't be converted to type of ");
print_generic_expr (dump_file, rhs, 0);
fprintf (dump_file, "\n");
}
continue;
}
}
else
val = v->value;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Modifying stmt:\n ");
print_gimple_stmt (dump_file, stmt, 0, 0);
}
gimple_assign_set_rhs_from_tree (&gsi, val);
update_stmt (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "into:\n ");
print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, "\n");
}
*m_something_changed = true;
if (maybe_clean_eh_stmt (stmt)
&& gimple_purge_dead_eh_edges (gimple_bb (stmt)))
*m_cfg_changed = true;
}
re PR tree-optimization/68619 (error: loop with header 6 not in loop tree) 2015-12-10 Jeff Law <law@redhat.com> PR tree-optimization/68619 * tree-ssa-dom.c (dom_opt_dom_walker::before_dom_children): Propgate return value from optimize_stmt. (dom_opt_dom_walker): Add new argument to dom_walker constructor. (pass_dominator:execute): If a block has an unreachable edge, remove all jump threads through any successor of the affected block. (record_equivalences_from_phis): Ignore alternative if the edge does not have EDGE_EXECUTABLE set. (single_incoming_edge_ignoring_loop_edges): Similarly. (optimize_stmt): If a gimple_code has a compile-time constant condition, return the edge taken for that constant value. Also change the condition to true/false as necessary. * domwalk.h (dom_walker::dom_walker): Add new argument skip_unreachable_blocks. Don't provide empty constructor body. (dom_walker::before_dom_children): Change return type. (dom_walker::bb_reachable): Declare new private method. (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::m_unreachable_dom): Declare new private data member. (dom_walker::m_skip_unreachable_blocks): Likewise. * domwalk.c: Include dumpfile.h. (dom_walker::dom_walker): New constructor. Initialize private data members. If needed, set EDGE_EXECUTABLE for all edges in the CFG, extracted from tree-ssa-sccvn.c. (dom_walker::bb_reachable): New method extracted from tree-ssa-sccvn.c (dom_walker::propagate_unreachable_to_edges): Likewise. (dom_walker::walk): Only call before_dom_children on reachable blocks. If before_dom_children returns an edge, then clear EDGE_EXECUTABLE for all other outgoing edges from the same block. For unreachable blocks, call propagate_unreachable_to_edges. Similarly, only call after_dom_children on reachable blocks. For unreachable blocks, conditionally clear m_unreachable_dom. * tree-ssa-sccvn.c (sccvn_dom_walker::unreachable_dom): Remove private data member. (sccvn_dom_walker::after_dom_children): Use methods from dom_walker class. (run_scc_vn): Likewise. (sccvn_dom_walker::before_dom_children): Likewise. Return the taken outgoing edge if a COND, SWITCH, or GOTO are optimized. * compare-elim.c (find_comparison_dom_walker::before_dom_children): Change return type to an edge. Always return NULL. * fwprop.c (single_def_use_dom_walker::before_dom_children): Likewise. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker::before_dom_children): Likewise. * ipa-prop.c (analysis_dom_walker::before_dom_children): Likewise. (ipcp_modif_dom_walker::before_dom_children): Likewise. * tree-into-ssa.c (rewrite_dom_walker::before_dom_children): Likewise. (rewrite_update_dom_walker::before_dom_children): Likewise. (mark_def_dom_children::before_dom_children): Likewise. * tree-ssa-dse.c (dse_dom_walker::before_dom_children): Likewise. * tree-ssa-loop-im.c (invariantness_dom_walker::before_dom_children): Likewise. (move_computations_dom_walker::before_dom_walker): Likewise. * tree-ssa-phiopt.c (nontrapping_dom_walker::before_dom_children): Likewise. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Likewise. * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children): Likewise. * tree-ssa-strlen.c (strlen_dom_walker::before_dom_children): Likewise. * tree-ssa-uncprop.c (uncprop_dom_walker::before_dom_children): Likewise. PR tree-optimization/68619 * gcc.dg/tree-ssa/pr68619-1.c: New test. * gcc.dg/tree-ssa/pr68619-2.c: New test. * gcc.dg/tree-ssa/pr68619-3.c: New test. * gcc.dg/tree-ssa/pr68619-4.c: New test. * gcc.dg/tree-ssa/pr68619-5.c: New test. From-SVN: r231527
2015-12-10 17:34:43 +01:00
return NULL;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
}
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
/* Update bits info of formal parameters as described in
ipcp_transformation_summary. */
static void
ipcp_update_bits (struct cgraph_node *node)
{
tree parm = DECL_ARGUMENTS (node->decl);
tree next_parm = parm;
ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
if (!ts || vec_safe_length (ts->bits) == 0)
return;
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
vec<ipa_bits *, va_gc> &bits = *ts->bits;
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
unsigned count = bits.length ();
for (unsigned i = 0; i < count; ++i, parm = next_parm)
{
if (node->clone.combined_args_to_skip
&& bitmap_bit_p (node->clone.combined_args_to_skip, i))
continue;
gcc_checking_assert (parm);
next_parm = DECL_CHAIN (parm);
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
if (!bits[i]
|| !(INTEGRAL_TYPE_P (TREE_TYPE (parm))
|| POINTER_TYPE_P (TREE_TYPE (parm)))
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
|| !is_gimple_reg (parm))
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
continue;
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
tree ddef = ssa_default_def (DECL_STRUCT_FUNCTION (node->decl), parm);
if (!ddef)
continue;
if (dump_file)
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
fprintf (dump_file, "Adjusting mask for param %u to ", i);
print_hex (bits[i]->mask, dump_file);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
fprintf (dump_file, "\n");
}
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
if (INTEGRAL_TYPE_P (TREE_TYPE (ddef)))
{
unsigned prec = TYPE_PRECISION (TREE_TYPE (ddef));
signop sgn = TYPE_SIGN (TREE_TYPE (ddef));
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
wide_int nonzero_bits = wide_int::from (bits[i]->mask, prec, UNSIGNED)
| wide_int::from (bits[i]->value, prec, sgn);
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
set_nonzero_bits (ddef, nonzero_bits);
}
else
{
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
unsigned tem = bits[i]->mask.to_uhwi ();
unsigned HOST_WIDE_INT bitpos = bits[i]->value.to_uhwi ();
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
unsigned align = tem & -tem;
unsigned misalign = bitpos & (align - 1);
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
ipa-cp.c (ipcp_alignment_lattice): Remove. 2016-10-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * ipa-cp.c (ipcp_alignment_lattice): Remove. (ipcp_param_lattices): Remove field alignment. (print_all_lattices): Remove call to ipcp_alignment_lattice::print. (set_all_contains_variable): Remove call to ipcp_alignment_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): Remove. (propagate_constants_accross_call): Remove call to propagate_alignment_accross_jump_function. (ipcp_store_alignment_results): Remove. (ipcp_driver): Remove call to ipcp_store_alignment_results. (propagate_bits_accross_jump_function): Handle ancestor jump function. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Remove pretty-printing of alignment jump function. (ipa_set_jf_unknown): Remove assignment to jfunc->alignment.known. (ipa_compute_jump_functions_for_edge): Adjust ipa_bits jump function for alignments and remove computing ipa_alignment jump function. (ipa_node_params_t::duplicate): Remove copying of src_trans->alignments. (ipa_write_jump_functions): Remove streaming for ipa_alignment. (ipa_read_jump_function): Remove reading of ipa_alignment. (write_ipcp_transformation_info): Remove streaming for alignment propagation summary. (read_ipcp_transformation_info): Remove reading of alignment propagation summary. (ipcp_update_alignments): Remove. (ipcp_update_bits): Adjust to set alignment for parameters of pointer type. (ipcp_transform_function): Remove call to ipcp_update_alignments() and remove assignment to (*ipcp_transformations)[node->uid].alignments. * ipa-prop.h (ipa_alignment): Remove. (ipa_jump_func): Remove field alignment. (ipcp_transformation_summary): Remove field alignments. * doc/invoke.texi: Mark fipa-cp-alignment as obsolete. * opts.c (default_options_table): Remove entry for fipa-cp-alignment. (enable_fdo_optimizations): Remove checking for fipa-cp-alignment. testsuite/ * gcc.dg/ipa/propalign-1.c: Adjust scan-ipa-dump. * gcc.dg/ipa/propalign-2.c: Likewise * gcc.dg/ipa/propalign-3.c: Likewise. * gcc.dg/ipa/propalign-4.c: Likewise. * gcc.dg/ipa/propalign-5.c: Likewise. From-SVN: r240898
2016-10-09 06:48:50 +02:00
if (align > 1)
{
if (dump_file)
fprintf (dump_file, "Adjusting align: %u, misalign: %u\n", align, misalign);
unsigned old_align, old_misalign;
struct ptr_info_def *pi = get_ptr_info (ddef);
bool old_known = get_ptr_info_alignment (pi, &old_align, &old_misalign);
if (old_known
&& old_align > align)
{
if (dump_file)
{
fprintf (dump_file, "But alignment was already %u.\n", old_align);
if ((old_misalign & (align - 1)) != misalign)
fprintf (dump_file, "old_misalign (%u) and misalign (%u) mismatch\n",
old_misalign, misalign);
}
continue;
}
if (old_known
&& ((misalign & (old_align - 1)) != old_misalign)
&& dump_file)
fprintf (dump_file, "old_misalign (%u) and misalign (%u) mismatch\n",
old_misalign, misalign);
set_ptr_info_alignment (pi, align, misalign);
}
}
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
}
}
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
/* Update value range of formal parameters as described in
ipcp_transformation_summary. */
static void
ipcp_update_vr (struct cgraph_node *node)
{
tree fndecl = node->decl;
tree parm = DECL_ARGUMENTS (fndecl);
tree next_parm = parm;
ipcp_transformation_summary *ts = ipcp_get_transformation_summary (node);
if (!ts || vec_safe_length (ts->m_vr) == 0)
return;
const vec<ipa_vr, va_gc> &vr = *ts->m_vr;
unsigned count = vr.length ();
for (unsigned i = 0; i < count; ++i, parm = next_parm)
{
if (node->clone.combined_args_to_skip
&& bitmap_bit_p (node->clone.combined_args_to_skip, i))
continue;
gcc_checking_assert (parm);
next_parm = DECL_CHAIN (parm);
tree ddef = ssa_default_def (DECL_STRUCT_FUNCTION (node->decl), parm);
if (!ddef || !is_gimple_reg (parm))
continue;
if (vr[i].known
&& (vr[i].type == VR_RANGE || vr[i].type == VR_ANTI_RANGE))
{
tree type = TREE_TYPE (ddef);
unsigned prec = TYPE_PRECISION (type);
if (INTEGRAL_TYPE_P (TREE_TYPE (ddef)))
{
if (dump_file)
{
fprintf (dump_file, "Setting value range of param %u ", i);
fprintf (dump_file, "%s[",
(vr[i].type == VR_ANTI_RANGE) ? "~" : "");
print_decs (vr[i].min, dump_file);
fprintf (dump_file, ", ");
print_decs (vr[i].max, dump_file);
fprintf (dump_file, "]\n");
}
set_range_info (ddef, vr[i].type,
wide_int_storage::from (vr[i].min, prec,
TYPE_SIGN (type)),
wide_int_storage::from (vr[i].max, prec,
TYPE_SIGN (type)));
}
else if (POINTER_TYPE_P (TREE_TYPE (ddef))
&& vr[i].type == VR_ANTI_RANGE
&& wi::eq_p (vr[i].min, 0)
&& wi::eq_p (vr[i].max, 0))
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
{
if (dump_file)
fprintf (dump_file, "Setting nonnull for %u\n", i);
set_ptr_nonnull (ddef);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
}
}
}
}
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
/* IPCP transformation phase doing propagation of aggregate values. */
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
unsigned int
ipcp_transform_function (struct cgraph_node *node)
{
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec<ipa_param_descriptor, va_gc> *descriptors = NULL;
struct ipa_func_body_info fbi;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
struct ipa_agg_replacement_value *aggval;
int param_count;
bool cfg_changed = false, something_changed = false;
gcc_checking_assert (cfun);
gcc_checking_assert (current_function_decl);
if (dump_file)
fprintf (dump_file, "Modification phase of node %s/%i\n",
node->name (), node->order);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> Martin Jambhor <mjambor@suse.cz> * common.opt: New option -fipa-bit-cp. * doc/invoke.texi: Document -fipa-bit-cp. * opts.c (default_options_table): Add entry for -fipa-bit-cp. (enable_fdo_optimizations): Check for flag_ipa_bit_cp. * tree-ssa-ccp.h: New header file. * tree-ssa-ccp.c: Include tree-ssa-ccp.h (bit_value_binop_1): Change to bit_value_binop_1 and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_unop_1): Change to bit_value_unop and export it. Replace all occurences of tree parameter by two new params: signop, int. (bit_value_binop): Change call from bit_value_binop_1 to bit_value_binop. (bit_value_assume_aligned): Likewise. (bit_value_unop): Change call from bit_value_unop_1 to bit_value_unop. (do_ssa_ccp): Pass nonzero_p || flag_ipa_cp_bit instead of nonzero_p to ccp_finalize. (ccp_finalize): Skip processing if val->mask == 0. * ipa-cp.c: Include tree-ssa-ccp.h (ipcp_bits_lattice): New class. (ipcp_param_lattice (bits_lattice): New member. (print_all_lattices): Call ipcp_bits_lattice::print. (set_all_contains_variable): Call ipcp_bits_lattice::set_to_bottom. (initialize_node_lattices): Likewise. (propagate_bits_accross_jump_function): New function. (propagate_constants_accross_call): Call propagate_bits_accross_jump_function. (ipcp_propagate_stage): Store parameter types when in_lto_p is true. (ipcp_store_bits_results): New function. (ipcp_driver): Call ipcp_store_bits_results. * ipa-prop.h (ipa_bits): New struct. (ipa_jump_func): Add new member bits of type ipa_bits. (ipa_param_descriptor): Change decl to decl_or_type. (ipa_get_param): Change decl to decl_or_type and assert on PARM_DECL. (ipa_get_type): New function. (ipcp_transformation_summary): New member bits. * ipa-prop.c (ipa_get_param_decl_index_1): s/decl/decl_or_type. (ipa_populate_param_decls): Likewise. (ipa_dump_param): Likewise. (ipa_print_node_jump_functions_for_edge): Pretty-print ipa_bits jump function. (ipa_set_jf_unknown): Set ipa_bits::known to false. (ipa_compute_jump_functions_for_edge): Compute jump function for bits propagation. (ipa_node_params_t::duplicate): Copy src->bits into dst->bits. (ipa_write_jump_function): Add streaming for ipa_bits. (ipa_read_jump_function): Add support for reading streamed ipa_bits. (write_ipcp_transformation_info): Add streaming for ipa_bits summary for ltrans. (read_ipcp_transfomration_info): Add support for reading streamed ipa_bits. (ipcp_update_bits): New function. (ipcp_transform_function): Call ipcp_update_bits. testsuite/ * gcc.dg/ipa/propbits-1.c: New test-case. * gcc.dg/ipa/propbits-2.c: Likewise. * gcc.dg/ipa/propbits-3.c: Likewise. Co-Authored-By: Martin Jambor <mjambor@suse.cz> From-SVN: r239769
2016-08-26 10:05:39 +02:00
ipcp_update_bits (node);
Add IPA VRP gcc/lto/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * lto-partition.c: Include tree-vrp.h. * lto.c: Likewise. gcc/testsuite/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * g++.dg/ipa/pure-const-3.C: Add -fno-ipa-vrp. Else constant arguments will be optimized away. * gcc.dg/ipa/vrp1.c: New test. * gcc.dg/ipa/vrp2.c: New test. * gcc.dg/ipa/vrp3.c: New test. gcc/ChangeLog: 2016-09-21 Kugan Vivekanandarajah <kuganv@linaro.org> * common.opt: New option -fipa-vrp. * ipa-cp.c (ipa_get_vr_lat): New. (ipcp_vr_lattice::print): Likewise. (print_all_lattices): Call ipcp_vr_lattice::print. (ipcp_vr_lattice::meet_with): New. (ipcp_vr_lattice::meet_with_1): Likewise. (ipcp_vr_lattice::top_p): Likewise. (ipcp_vr_lattice::bottom_p): Likewsie. (ipcp_vr_lattice::set_to_bottom): Likewise. (set_all_contains_variable): Call VR set_to_bottom. (initialize_node_lattices): Init VR lattices. (propagate_vr_accross_jump_function): New. (propagate_constants_accross_call): Call propagate_vr_accross_jump_function. (ipcp_store_vr_results): New. (ipcp_driver): Handle VR. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Handle VR. (ipa_set_jf_unknown): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_node_params_t::duplicate): Likewise. (ipa_write_jump_function): Likewise. (ipa_read_jump_function): Likewise. (write_ipcp_transformation_info): Likewise. (read_ipcp_transformation_info): Likewise. (ipcp_update_vr): New. (ipcp_transform_function): Handle VR. * ipa-prop.h (struct ipa_vr): New. * cgraph.c: Include tree-vrp.h. * cgraphunit.c: Likewise. * ipa-utils.c: Likewise. * ipa.c: Likewise. From-SVN: r240292
2016-09-21 01:29:05 +02:00
ipcp_update_vr (node);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
aggval = ipa_get_agg_replacements_for_node (node);
if (!aggval)
return 0;
Autogenerated fixes of "->symbol." to "->" This is the autogenerated part of the conversion of the symtable types to a C++ class hierarchy. gcc/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * asan.c (asan_finish_file): Update for conversion of symtab types to a true class hierarchy. * cfgexpand.c (estimated_stack_frame_size): Likewise. * cgraph.c (cgraph_get_body): Likewise. (cgraph_get_create_real_symbol_node): Likewise. (verify_cgraph_node): Likewise. (verify_edge_corresponds_to_fndecl): Likewise. (verify_edge_count_and_frequency): Likewise. (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise. (cgraph_node_cannot_return): Likewise. (cgraph_set_pure_flag_1): Likewise. (cgraph_set_const_flag_1): Likewise. (cgraph_set_nothrow_flag_1): Likewise. (cgraph_make_node_local_1): Likewise. (cgraph_for_node_and_aliases): Likewise. (cgraph_for_node_thunks_and_aliases): Likewise. (cgraph_node_can_be_local_p): Likewise. (cgraph_node_cannot_be_local_p_1): Likewise. (cgraph_function_body_availability): Likewise. (dump_cgraph_node): Likewise. (cgraph_rtl_info): Likewise. (cgraph_mark_address_taken_node): Likewise. (cgraph_remove_node): Likewise. (cgraph_release_function_body): Likewise. (cgraph_update_edges_for_call_stmt_node): Likewise. (cgraph_redirect_edge_call_stmt_to_callee): Likewise. (cgraph_make_edge_direct): Likewise. (cgraph_resolve_speculation): Likewise. (cgraph_speculative_call_info): Likewise. (cgraph_turn_edge_to_speculative): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_set_call_stmt): Likewise. (cgraph_node_for_asm): Likewise. (cgraph_add_thunk): Likewise. (cgraph_same_body_alias): Likewise. (cgraph_create_function_alias): Likewise. (cgraph_create_node): Likewise. (cgraph_create_empty_node): Likewise. (record_function_versions): Likewise. (used_from_object_file_p): Likewise. * cgraph.h (symtab_can_be_discarded): Likewise. (symtab_real_symbol_p): Likewise. (cgraph_mark_force_output_node): Likewise. (cgraph_edge_recursive_p): Likewise. (symtab_alias_target): Likewise. (varpool_all_refs_explicit_p): Likewise. (varpool_can_remove_if_no_refs): Likewise. (cgraph_only_called_directly_or_aliased_p): Likewise. (cgraph_next_function_with_gimple_body): Likewise. (cgraph_first_function_with_gimple_body): Likewise. (cgraph_function_with_gimple_body_p): Likewise. (cgraph_next_function): Likewise. (cgraph_first_function): Likewise. (cgraph_next_defined_function): Likewise. (cgraph_first_defined_function): Likewise. (varpool_next_defined_variable): Likewise. (varpool_first_defined_variable): Likewise. (varpool_next_static_initializer): Likewise. (varpool_first_static_initializer): Likewise. (varpool_next_variable): Likewise. (varpool_first_variable): Likewise. (varpool_node_name): Likewise. (varpool): Likewise. (cgraph): Likewise. (is_a_helper <varpool_node>::test): Likewise. (is_a_helper <cgraph_node>::test): Likewise. (varpool_variable_node): Likewise. (cgraph_function_or_thunk_node): Likewise. (varpool_alias_target): Likewise. (cgraph_alias_target): Likewise. (cgraph_node_name): Likewise. (varpool_node_asm_name): Likewise. (cgraph_node_asm_name): Likewise. * cgraphbuild.c (remove_cgraph_callee_edges): Likewise. (cgraph_rebuild_references): Likewise. (rebuild_cgraph_edges): Likewise. (record_eh_tables): Likewise. (build_cgraph_edges): Likewise. (mark_store): Likewise. (mark_load): Likewise. (mark_address): Likewise. (record_type_list): Likewise. (record_reference): Likewise. * cgraphclones.c (cgraph_materialize_all_clones): Likewise. (cgraph_materialize_clone): Likewise. (cgraph_function_versioning): Likewise. (cgraph_copy_node_for_versioning): Likewise. (update_call_expr): Likewise. (cgraph_find_replacement_node): Likewise. (cgraph_create_virtual_clone): Likewise. (cgraph_clone_node): Likewise. * cgraphunit.c (compile): Likewise. (output_weakrefs): Likewise. (output_in_order): Likewise. (expand_function): Likewise. (assemble_thunks_and_aliases): Likewise. (expand_thunk): Likewise. (mark_functions_to_output): Likewise. (handle_alias_pairs): Likewise. (analyze_functions): Likewise. (walk_polymorphic_call_targets): Likewise. (varpool_finalize_decl): Likewise. (process_function_and_variable_attributes): Likewise. (cgraph_process_same_body_aliases): Likewise. (analyze_function): Likewise. (cgraph_add_new_function): Likewise. (cgraph_finalize_function): Likewise. (referred_to_p): Likewise. (cgraph_reset_node): Likewise. (cgraph_process_new_functions): Likewise. (enqueue_node): Likewise. (decide_is_symbol_needed): Likewise. * coverage.c (coverage_compute_profile_id): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise. (reference_to_unused): Likewise. * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise. * gimplify.c (unvisit_body): Likewise. (unshare_body): Likewise. * ipa-cp.c (ipcp_generate_summary): Likewise. (ipcp_decision_stage): Likewise. (identify_dead_nodes): Likewise. (decide_whether_version_node): Likewise. (decide_about_value): Likewise. (perhaps_add_new_callers): Likewise. (create_specialized_node): Likewise. (update_profiling_info): Likewise. (ipcp_propagate_stage): Likewise. (estimate_local_effects): Likewise. (good_cloning_opportunity_p): Likewise. (devirtualization_time_bonus): Likewise. (propagate_constants_accross_call): Likewise. (initialize_node_lattices): Likewise. (ipcp_cloning_candidate_p): Likewise. (determine_versionability): Likewise. (print_all_lattices): Likewise. (print_lattice): Likewise. (ipcp_discover_new_direct_edges): Likewise. * ipa-devirt.c (ipa_devirt): Likewise. (likely_target_p): Likewise. (update_type_inheritance_graph): Likewise. (possible_polymorphic_call_target_p): Likewise. (dump_possible_polymorphic_call_targets): Likewise. (devirt_variable_node_removal_hook): Likewise. (record_binfo): Likewise. (maybe_record_node): Likewise. (build_type_inheritance_graph): Likewise. * ipa-inline-analysis.c (inline_write_summary): Likewise. (inline_generate_summary): Likewise. (inline_analyze_function): Likewise. (do_estimate_growth): Likewise. (simple_edge_hints): Likewise. (estimate_node_size_and_time): Likewise. (estimate_edge_devirt_benefit): Likewise. (compute_inline_parameters): Likewise. (estimate_function_body_sizes): Likewise. (compute_bb_predicates): Likewise. (initialize_inline_failed): Likewise. (dump_inline_summary): Likewise. (dump_inline_edge_summary): Likewise. * ipa-inline-transform.c (inline_transform): Likewise. (preserve_function_body_p): Likewise. (save_inline_function_body): Likewise. (inline_call): Likewise. (clone_inlined_nodes): Likewise. (can_remove_node_now_p): Likewise. (can_remove_node_now_p_1): Likewise. * ipa-inline.c (early_inliner): Likewise. (early_inline_small_functions): Likewise. (inline_always_inline_functions): Likewise. (ipa_inline): Likewise. (flatten_function): Likewise. (inline_small_functions): Likewise. (speculation_useful_p): Likewise. (recursive_inlining): Likewise. (update_caller_keys): Likewise. (reset_edge_caches): Likewise. (update_edge_key): Likewise. (edge_badness): Likewise. (relative_time_benefit): Likewise. (want_inline_self_recursive_call_p): Likewise. (want_inline_small_function_p): Likewise. (want_early_inline_function_p): Likewise. (num_calls): Likewise. (can_early_inline_edge_p): Likewise. (can_inline_edge_p): Likewise. (report_inline_failed_reason): Likewise. * ipa-profile.c (ipa_profile): Likewise. (ipa_propagate_frequency): Likewise. (ipa_propagate_frequency_1): Likewise. (ipa_profile_generate_summary): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_section): Likewise. (ipa_modify_call_arguments): Likewise. (ipa_print_node_params): Likewise. (propagate_controlled_uses): Likewise. (update_indirect_edges_after_inlining): Likewise. (remove_described_reference): Likewise. (ipa_make_edge_direct_to_target): Likewise. (ipa_analyze_node): Likewise. (ipa_analyze_params_uses): Likewise. (ipa_compute_jump_functions): Likewise. (ipa_get_callee_param_type): Likewise. (ipa_print_node_jump_functions): Likewise. (ipa_initialize_node_params): Likewise. (ipa_populate_param_decls): Likewise. (ipa_func_spec_opts_forbid_analysis_p): Likewise. (write_agg_replacement_chain): Likewise. (ipa_write_node_info): Likewise. (ipa_edge_duplication_hook): Likewise. (try_decrement_rdesc_refcount): Likewise. * ipa-pure-const.c (propagate_nothrow): Likewise. (propagate_pure_const): Likewise. (pure_const_read_summary): Likewise. (pure_const_write_summary): Likewise. (analyze_function): Likewise. * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise. (ipa_ref_referring_ref_list): Likewise. * ipa-ref.c (ipa_clear_stmts_in_references): Likewise. (ipa_remove_stmt_references): Likewise. (ipa_find_reference): Likewise. (ipa_dump_referring): Likewise. (ipa_dump_references): Likewise. (ipa_record_reference): Likewise. * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise. (ipa_reference_write_optimization_summary): Likewise. (write_node_summary_p): Likewise. (propagate): Likewise. (read_write_all_from_decl): Likewise. (generate_summary): Likewise. (analyze_function): Likewise. (propagate_bits): Likewise. (ipa_reference_get_not_written_global): Likewise. (ipa_reference_get_not_read_global): Likewise. * ipa-split.c (execute_split_functions): Likewise. (split_function): Likewise. * ipa-utils.c (ipa_merge_profiles): Likewise. (dump_cgraph_node_set): Likewise. (ipa_reverse_postorder): Likewise. (ipa_edge_within_scc): Likewise. (ipa_get_nodes_in_cycle): Likewise. (ipa_free_postorder_info): Likewise. (ipa_reduced_postorder): Likewise. (searchc): Likewise. (recursive_call_p): Likewise. * ipa.c (ipa_cdtor_merge): Likewise. (record_cdtor_fn): Likewise. (function_and_variable_visibility): Likewise. (varpool_externally_visible_p): Likewise. (cgraph_externally_visible_p): Likewise. (comdat_can_be_unshared_p): Likewise. (comdat_can_be_unshared_p_1): Likewise. (address_taken_from_non_vtable_p): Likewise. (ipa_discover_readonly_nonaddressable_vars): Likewise. (symtab_remove_unreachable_nodes): Likewise. (walk_polymorphic_call_targets): Likewise. (process_references): Likewise. (enqueue_node): Likewise. (has_addr_references_p): Likewise. (cgraph_non_local_node_p_1): Likewise. * is-a.h (varpool_analyze_node): Likewise. * lto-cgraph.c (input_symtab): Likewise. (merge_profile_summaries): Likewise. (input_cgraph_1): Likewise. (input_edge): Likewise. (input_varpool_node): Likewise. (input_node): Likewise. (input_overwrite_node): Likewise. (compute_ltrans_boundary): Likewise. (output_refs): Likewise. (lto_output_varpool_node): Likewise. (lto_output_node): Likewise. (reachable_from_other_partition_p): Likewise. (referenced_from_other_partition_p): Likewise. (lto_output_edge): Likewise. (output_node_opt_summary): Likewise. (add_node_to): Likewise. (reachable_from_this_partition_p): Likewise. (lto_set_symtab_encoder_in_partition): Likewise. (lto_symtab_encoder_in_partition_p): Likewise. (lto_set_symtab_encoder_encode_initializer): Likewise. (lto_symtab_encoder_encode_initializer_p): Likewise. (lto_set_symtab_encoder_encode_body): Likewise. (lto_symtab_encoder_encode_body_p): Likewise. * lto-section-in.c (lto_free_function_in_decl_state_for_node): Likewise. * lto-streamer-in.c (lto_read_body): Likewise. (fixup_call_stmt_edges): Likewise. (fixup_call_stmt_edges_1): Likewise. * lto-streamer-out.c (produce_symtab): Likewise. (output_symbol_p): Likewise. (write_symbol): Likewise. (lto_output): Likewise. (copy_function): Likewise. (output_function): Likewise. * passes.c (function_called_by_processed_nodes_p): Likewise. (ipa_write_optimization_summaries): Likewise. (ipa_write_summaries): Likewise. (do_per_function_toporder): Likewise. (do_per_function): Likewise. (dump_passes): Likewise. * symtab.c (symtab_semantically_equivalent_p): Likewise. (symtab_nonoverwritable_alias): Likewise. (symtab_nonoverwritable_alias_1): Likewise. (symtab_for_node_and_aliases): Likewise. (symtab_resolve_alias): Likewise. (fixup_same_cpp_alias_visibility): Likewise. (symtab_alias_ultimate_target): Likewise. (symtab_used_from_object_file_p): Likewise. (verify_symtab_base): Likewise. (dump_symtab_base): Likewise. (symtab_node_name): Likewise. (symtab_node_asm_name): Likewise. (symtab_dissolve_same_comdat_group_list): Likewise. (symtab_add_to_same_comdat_group): Likewise. (symtab_unregister_node): Likewise. (symtab_insert_node_to_hashtable): Likewise. (symtab_register_node): Likewise. (unlink_from_assembler_name_hash): Likewise. (insert_to_assembler_name_hash): Likewise. (eq_assembler_name): Likewise. (hash_node_by_assembler_name): Likewise. (eq_node): Likewise. (hash_node): Likewise. * toplev.c (wrapup_global_declaration_2): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_calls_redirect): Likewise. (ipa_tm_insert_gettmclone_call): Likewise. (ipa_tm_insert_irr_call): Likewise. (ipa_tm_create_version): Likewise. (ipa_tm_create_version_alias): Likewise. (ipa_tm_mark_forced_by_abi_node): Likewise. (ipa_tm_mark_force_output_node): Likewise. (ipa_tm_diagnose_tm_safe): Likewise. (ipa_tm_mayenterirr_function): Likewise. (ipa_tm_scan_irr_function): Likewise. (ipa_tm_note_irrevocable): Likewise. (ipa_tm_scan_calls_clone): Likewise. (get_cg_data): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-emutls.c (ipa_lower_emutls): Likewise. (create_emultls_var): Likewise. (lower_emutls_function_body): Likewise. (gen_emutls_addr): Likewise. (emutls_decl): Likewise. (new_emutls_decl): Likewise. * tree-inline.c (tree_function_versioning): Likewise. (optimize_inline_calls): Likewise. (expand_call_inline): Likewise. (estimate_num_insns): Likewise. (copy_bb): Likewise. (delete_unreachable_blocks_update_callgraph): Likewise. * tree-nested.c (gimplify_all_functions): Likewise. (create_nesting_tree): Likewise. (check_for_nested_with_variably_modified): Likewise. * tree-pretty-print.c (dump_function_header): Likewise. * tree-profile.c (tree_profiling): Likewise. * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise. (modify_function): Likewise. (convert_callers): Likewise. (convert_callers_for_node): Likewise. * tree-ssa-structalias.c (ipa_pta_execute): Likewise. (associate_varinfo_to_alias): Likewise. (create_variable_info_for): Likewise. (get_constraint_for_ssa_var): Likewise. * tree-vectorizer.c (increase_alignment): Likewise. * tree.c (find_decls_types_in_var): Likewise. (find_decls_types_in_node): Likewise. (free_lang_data_in_decl): Likewise. * value-prof.c (gimple_ic_transform): Likewise. (gimple_ic): Likewise. (check_ic_target): Likewise. (init_node_map): Likewise. * varasm.c (decl_binds_to_current_def_p): Likewise. (default_binds_local_p_1): Likewise. (dump_tm_clone_pairs): Likewise. (assemble_alias): Likewise. (find_decl): Likewise. (mark_decl_referenced): Likewise. * varpool.c (varpool_for_node_and_aliases): Likewise. (varpool_extra_name_alias): Likewise. (varpool_create_variable_alias): Likewise. (add_new_static_var): Likewise. (varpool_finalize_named_section_flags): Likewise. (varpool_remove_unreferenced_decls): Likewise. (enqueue_node): Likewise. (varpool_assemble_decl): Likewise. (assemble_aliases): Likewise. (varpool_analyze_node): Likewise. (cgraph_variable_initializer_availability): Likewise. (varpool_add_new_variable): Likewise. (ctor_for_folding): Likewise. (dump_varpool_node): Likewise. (varpool_remove_initializer): Likewise. (varpool_remove_node): Likewise. (varpool_node_for_decl): Likewise. (varpool_create_empty_node): Likewise. * config/i386/i386.c (ix86_generate_version_dispatcher_body): Likewise. (ix86_get_function_versions_dispatcher): Likewise. gcc/ada/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * gcc-interface/trans.c (finalize_nrv): Update for conversion of symtab types to a true class hierarchy. * gcc-interface/utils.c (gnat_write_global_declarations): Likewise. gcc/c-family/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * c-gimplify.c (c_genericize): Update for conversion of symtab types to a true class hierarchy. * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise. gcc/cp/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * call.c (mark_versions_used): Update for conversion of symtab types to a true class hierarchy. * decl2.c (cp_write_global_declarations): Likewise. (clear_decl_external): Likewise. (build_java_method_aliases): Likewise. (collect_candidates_for_java_method_aliases): Likewise. (mark_needed): Likewise. (var_finalized_p): Likewise. (maybe_make_one_only): Likewise. (maybe_emit_vtables): Likewise. * lambda.c (maybe_add_lambda_conv_op): Likewise. * method.c (use_thunk): Likewise. * optimize.c (maybe_clone_body): Likewise. * tree.c (cp_fix_function_decl_p): Likewise. gcc/java/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * decl.c (java_mark_decl_local): Update for conversion of symtab types to a true class hierarchy. gcc/lto/ Patch autogenerated by refactor_symtab.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 58bb219cc090b2f4516a9297d868c245495ee622 * lto-partition.c (lto_promote_cross_file_statics): Update for conversion of symtab types to a true class hierarchy. (rename_statics): Likewise. (promote_symbol): Likewise. (privatize_symbol_name): Likewise. (lto_balanced_map): Likewise. (varpool_node_cmp): Likewise. (node_cmp): Likewise. (lto_1_to_1_map): Likewise. (undo_partition): Likewise. (add_symbol_to_partition): Likewise. (contained_in_symbol): Likewise. (add_symbol_to_partition_1): Likewise. (add_references_to_partition): Likewise. (symbol_partitioned_p): Likewise. (get_symbol_class): Likewise. (lto_max_map): Likewise. * lto-symtab.c (lto_symtab_prevailing_decl): Likewise. (lto_symtab_merge_symbols): Likewise. (lto_symtab_merge_symbols_1): Likewise. (lto_symtab_merge_decls): Likewise. (lto_symtab_merge_decls_1): Likewise. (lto_symtab_merge_decls_2): Likewise. (lto_symtab_resolve_symbols): Likewise. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_symbol_p): Likewise. (lto_symtab_resolve_replaceable_p): Likewise. (lto_symtab_merge): Likewise. (lto_varpool_replace_node): Likewise. (lto_cgraph_replace_node): Likewise. * lto.c (lto_main): Likewise. (do_whole_program_analysis): Likewise. (materialize_cgraph): Likewise. (read_cgraph_and_symbols): Likewise. (cmp_partitions_order): Likewise. (lto_materialize_function): Likewise. (has_analyzed_clone_p): Likewise. From-SVN: r204171
2013-10-29 19:30:00 +01:00
param_count = count_formal_params (node->decl);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
if (param_count == 0)
return 0;
adjust_agg_replacement_values (node, aggval);
if (dump_file)
ipa_dump_agg_replacement_values (dump_file, aggval);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
fbi.node = node;
fbi.info = NULL;
fbi.bb_infos = vNULL;
fbi.bb_infos.safe_grow_cleared (last_basic_block_for_fn (cfun));
fbi.param_count = param_count;
fbi.aa_walked = 0;
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec_safe_grow_cleared (descriptors, param_count);
ipa_populate_param_decls (node, *descriptors);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
calculate_dominance_info (CDI_DOMINATORS);
ipcp_modif_dom_walker (&fbi, descriptors, aggval, &something_changed,
&cfg_changed).walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2014-05-23 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * params.def (PARAM_IPA_MAX_AA_STEPS): New param. * ipa-prop.h (ipa_node_params): Rename uses_analysis_done to analysis_done, update all uses. * ipa-prop.c: Include domwalk.h (param_analysis_info): Removed. (param_aa_status): New type. (ipa_bb_info): Likewise. (func_body_info): Likewise. (ipa_get_bb_info): New function. (aa_overwalked): Likewise. (find_dominating_aa_status): Likewise. (parm_bb_aa_status_for_bb): Likewise. (parm_preserved_before_stmt_p): Changed to use new param AA info. (load_from_unmodified_param): Accept func_body_info as a parameter instead of parms_ainfo. (parm_ref_data_preserved_p): Changed to use new param AA info. (parm_ref_data_pass_through_p): Likewise. (ipa_load_from_parm_agg_1): Likewise. Update callers. (compute_complex_assign_jump_func): Changed to use new param AA info. (compute_complex_ancestor_jump_func): Likewise. (ipa_compute_jump_functions_for_edge): Likewise. (ipa_compute_jump_functions): Removed. (ipa_compute_jump_functions_for_bb): New function. (ipa_analyze_indirect_call_uses): Likewise, moved variable declarations down. (ipa_analyze_virtual_call_uses): Accept func_body_info instead of node and info, moved variable declarations down. (ipa_analyze_call_uses): Accept and pass on func_body_info instead of node and info. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Removed. (ipa_analyze_params_uses_in_bb): New function. (ipa_analyze_controlled_uses): Likewise. (free_ipa_bb_info): Likewise. (analysis_dom_walker): New class. (ipa_analyze_node): Handle node-specific forbidden analysis, initialize and free func_body_info, use dominator walker. (ipcp_modif_dom_walker): New class. (ipcp_transform_function): Create and free func_body_info, use ipcp_modif_dom_walker, moved a lot of functionality there. From-SVN: r210864
2014-05-23 17:52:20 +02:00
int i;
struct ipa_bb_info *bi;
FOR_EACH_VEC_ELT (fbi.bb_infos, i, bi)
free_ipa_bb_info (bi);
fbi.bb_infos.release ();
free_dominance_info (CDI_DOMINATORS);
ipa-prop.h (ipa_alignment): New type. 2014-12-04 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_alignment): New type. (ipa_jump_func): New field alignment. (ipcp_transformation_summary) New type. (ipcp_grow_transformations_if_necessary): Declare. (ipa_node_agg_replacements): Removed. (ipcp_transformations): Declare. (ipcp_get_transformation_summary): New function. (ipa_get_agg_replacements_for_node): Use it. * ipa-cp.c (ipcp_param_lattices): New field alignment. (print_all_lattices): Also print alignment. (alignment_bottom_p): New function. (set_alignment_to_bottom): Likewise. (set_all_contains_variable): Also set alignment to bottom. (initialize_node_lattices): Likewise. (propagate_alignment_accross_jump_function): New function. (propagate_constants_accross_call): Call it. (ipcp_store_alignment_results): New function. (ipcp_driver): Call it. * ipa-prop.c (ipa_node_agg_replacements): Removed. (ipcp_transformations): New. (ipa_print_node_jump_functions_for_edge): Also print alignment. (ipa_set_jf_unknown): New function. (detect_type_change_from_memory_writes): Use ipa_set_jf_unknown. (ipa_compute_jump_functions_for_edge): Also calculate alignment. (update_jump_functions_after_inlining): Use ipa_set_jf_unknown. (ipcp_grow_transformations_if_necessary): New function. (ipa_set_node_agg_value_chain): Use ipcp_transformations. (ipa_node_removal_hook): Likewise. (ipa_node_duplication_hook): Also duplicate alignment results. (ipa_write_jump_function): Also stream alignments. (ipa_read_jump_function): Use ipa_set_jf_unknown, also stream alignments. (write_agg_replacement_chain): Renamed to write_ipcp_transformation_info, also stream alignments. (read_agg_replacement_chain): Renamed to read_ipcp_transformation_info, also stream alignments. (ipa_prop_write_all_agg_replacement): Renamed to ipcp_write_transformation_summaries. Stream always. (ipa_prop_read_all_agg_replacement): Renamed to ipcp_read_transformation_summaries. (ipcp_update_alignments): New function. (ipcp_transform_function): Call it, free also alignments. testsuite/ * gcc.dg/ipa/propalign-1.c: New test. * gcc.dg/ipa/propalign-2.c: Likewise. From-SVN: r218369
2014-12-04 15:37:01 +01:00
(*ipcp_transformations)[node->uid].agg_values = NULL;
(*ipcp_transformations)[node->uid].bits = NULL;
(*ipcp_transformations)[node->uid].m_vr = NULL;
[PR 79108] Put ipa_node_params to GC memory 2017-01-23 Martin Jambor <mjambor@suse.cz> PR ipa/79108 * ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()). (ipa_node_params): Annotate with GTY((for_user)). Make descriptors field a pointer to garbage collected vector, mark lattices and ipcp_orig_node with GTY((skip)). (ipa_get_param_count): Adjust to descriptors being a pointer. (ipa_get_param): Likewise. (ipa_get_type): Likewise. (ipa_get_param_move_cost): Likewise. (ipa_set_param_used): Likewise. (ipa_get_controlled_uses): Likewise. (ipa_set_controlled_uses): Likewise. (ipa_is_param_used): Likewise. (ipa_node_params_t): Move into garbage collector. New methods insert and remove. (ipa_node_params_sum): Annotate wth GTY(()). (ipa_check_create_node_params): Adjust to ipa_node_params_sum being garbage collected. (ipa_load_from_parm_agg): Adjust declaration. * ipa-icf.c (param_used_p): Adjust to descriptors being a pointer. * ipa-profile.c (ipa_profile): Likewise. * ipa-prop.c (ipa_get_param_decl_index_1): Likewise. (ipa_populate_param_decls): Make descriptors parameter garbage collected. (ipa_dump_param): Adjust to descriptors being a pointer. (ipa_alloc_node_params): Likewise. (ipa_initialize_node_params): Likewise. (load_from_param_1): Make descriptors parameter garbage collected. (load_from_unmodified_param): Likewise. (load_from_param): Likewise. (ipa_load_from_parm_agg): Likewise. (ipa_node_params::~ipa_node_params): Removed. (ipa_free_all_node_params): Remove call to delete operator. (ipa_node_params_t::insert): New. (ipa_node_params_t::remove): Likewise. (ipa_node_params_t::duplicate): Adjust to descriptors being a pointer, copy known_csts and known_contexts vectors. (ipa_read_node_info): Adjust to descriptors being a pointer. (ipcp_modif_dom_walker): Make m_descriptors field garbage collected. (ipcp_transform_function): Make descriptors variable garbage collected. testsuite/ * gfortran.dg/lto/pr79108_0.f90: New test. From-SVN: r244802
2017-01-23 14:01:31 +01:00
vec_free (descriptors);
re PR tree-optimization/53787 (Possible IPA-SRA / IPA-CP improvement) 2012-11-07 Martin Jambor <mjambor@suse.cz> PR tree-optimization/53787 * ipa-cp.c (ipcp_value_source): New field offset. (ipcp_agg_lattice): New type. (ipcp_param_lattices): Likewise, move virt_call from ipcp_lattice here. (ipcp_agg_lattice_pool): New variable. (ipa_get_parm_lattices): New function. (ipa_get_lattice): Turned into ipa_get_scalar_lat, use the above. Adjusted all callers. (print_lattice): New function. (print_all_lattices): Use the above, also print aggregate lattices. (set_agg_lats_to_bottom): New function. (set_agg_lats_contain_variable): Likewise. (set_all_contains_variable): Likewise. (initialize_node_lattices): Also handle aggregate lattices, set virt_call in ipcp_param_lattices. (add_value_source): Handle offsets. (add_value_to_lattice): Likewise. (add_scalar_value_to_lattice): New function. (propagate_vals_accross_pass_through): Use add_scalar_value_to_lattice. (propagate_vals_accross_ancestor): Likewise. (propagate_accross_jump_function): Renamed to propagate_scalar_accross_jump_function, use add_scalar_value_to_lattice. (set_check_aggs_by_ref): New function. (merge_agg_lats_step): Likewise. (set_chain_of_aglats_contains_variable): Likewise. (merge_aggregate_lattices): Likewise. (propagate_constants_accross_call): Also handle aggregate lattices. (hint_time_bonus): New function. (context_independent_aggregate_values): Likewise. (gather_context_independent_values): Also handle agggregate values. (agg_jmp_p_vec_for_t_vec): New function. (estimate_local_effects): Also handle agggregate values. (add_all_node_vals_to_toposort): Likewise. (ipcp_propagate_stage): Use struct ipcp_param_lattices. (get_clone_agg_value): New function. (cgraph_edge_brings_value_p): Also handle agggregate values. (create_specialized_node): Likewise. (find_more_values_for_callers_subset): Rename to find_more_scalar_values_for_callers_subset. Modify dump. (copy_plats_to_inter): New function. (intersect_with_plats): Likewise. (agg_replacements_to_vector): Likewise. (intersect_with_agg_replacements): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. (cgraph_edge_brings_all_scalars_for_node): Likewise. (cgraph_edge_brings_all_agg_vals_for_node): Likewise. (perhaps_add_new_callers): Old functionality moved to cgraph_edge_brings_all_scalars_for_node, call it and cgraph_edge_brings_all_agg_vals_for_node. (ipcp_val_in_agg_replacements_p): New function. (decide_about_value): New function. (decide_whether_version_node): A lot of functionality moved to decide_about_value. Also handle agggregate values. (ipcp_driver): Also allocate ipcp_agg_lattice_pool. (pass_ipa_cp): Fill in new entries. * ipa-prop.c (ipa_node_agg_replacements): New variable. (free_parms_ainfo): New function. (ipa_analyze_node): Use free_parms_ainfo to free stuff. (ipa_find_agg_cst_for_param): Do not rely on offset ordering. (ipa_set_node_agg_value_chain): New function. (ipa_node_removal_hook): Also handle ipa_node_agg_replacements. (ipa_node_duplication_hook): Likewise. (ipa_free_all_structures_after_ipa_cp): Also free ipcp_agg_lattice_pool. (ipa_free_all_structures_after_iinln): Likewise. (ipa_dump_agg_replacement_values): New function. (write_agg_replacement_chain): Likewise. (read_agg_replacement_chain): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (read_replacements_section): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (adjust_agg_replacement_values): Likewise. (ipcp_transform_function): Likewise. * ipa-prop.h: Also define heap vector of ipa_agg_jf_item_t and of ipa_agg_jump_function_t. (ipa_node_params): Make lattices an array of ipcp_param_lattices. (ipa_agg_replacement_value): New type and its vector. (ipa_set_node_agg_value_chain) Declare. (ipa_node_agg_replacements): Likewise. (ipa_get_agg_replacements_for_node): New function. (ipcp_agg_lattice_pool): Declare. (ipa_dump_agg_replacement_values): Likewise. (ipa_prop_write_all_agg_replacement): Likewise. (ipa_prop_read_all_agg_replacement): Likewise. (ipcp_transform_function): Likewise. * ipa-inline-analysis.c (estimate_ipcp_clone_size_and_time): Pass around known aggregates and hints. * ipa-inline.h: include ipa-prop.h. (estimate_ipcp_clone_size_and_time): Adjust declaration. * lto-streamer.h (lto_section_type): New item LTO_section_ipcp_transform. * lto-section-in.c (lto_section_name): New element ipcp_trans. * params.def (PARAM_IPA_CP_LOOP_HINT_BONUS): New parameter. * Makefile.in (IPA_INLINE_H): New. Use everywhee instead of ipa-inline.h. * testsuite/gcc.dg/ipa/ipa-5.c: Adjust. * testsuite/gcc.dg/ipa/ipcp-agg-1.c: New test. * testsuite/gcc.dg/ipa/ipcp-agg-2.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-3.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-4.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-5.c: Likewise. * testsuite/gcc.dg/ipa/ipcp-agg-6.c: Likewise. * testsuite/gfortran.dg/pr48636.f90: Add -fno-ipa-cp. * testsuite/gfortran.dg/pr48636-2.f90: New test. * testsuite/gfortran.dg/pr53787.f90: Likewise. From-SVN: r193298
2012-11-07 16:55:54 +01:00
if (!something_changed)
return 0;
else if (cfg_changed)
return TODO_update_ssa_only_virtuals | TODO_cleanup_cfg;
else
return TODO_update_ssa_only_virtuals;
}
[PR 78140] Reuse same IPA bits and VR info 2017-03-01 Martin Jambor <mjambor@suse.cz> PR lto/78140 * ipa-prop.h (ipa_bits): Removed field known. (ipa_jump_func): Removed field vr_known. Changed fields bits and m_vr to pointers. Adjusted their comments to warn about their sharing. (ipcp_transformation_summary): Change bits to a vector of pointers. (ipa_check_create_edge_args): Moved to ipa-prop.c, declare. (ipa_get_ipa_bits_for_value): Declare. * tree-vrp.h (value_range): Mark as GTY((for_user)). * ipa-prop.c (ipa_bit_ggc_hash_traits): New. (ipa_bits_hash_table): Likewise. (ipa_vr_ggc_hash_traits): Likewise. (ipa_vr_hash_table): Likewise. (ipa_print_node_jump_functions_for_edge): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_set_jf_unknown): Likewise. (ipa_get_ipa_bits_for_value): New function. (ipa_set_jfunc_bits): Likewise. (ipa_get_value_range): New overloaded functions. (ipa_set_jfunc_vr): Likewise. (ipa_compute_jump_functions_for_edge): Use the above functions to construct bits and vr parts of jump functions. (ipa_check_create_edge_args): Move here from ipa-prop.h, also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipcp_grow_transformations_if_necessary): Also allocate ipa_bits_hash_table and ipa_vr_hash_table if they do not already exist. (ipa_node_params_t::duplicate): Do not copy bits, just pointers to them. Fix too long lines. (ipa_write_jump_function): Adjust for bits and m_vr being pointers and vr_known being removed. (ipa_read_jump_function): Use new setter functions to construct bits and vr parts of jump functions or set them to NULL. (write_ipcp_transformation_info): Adjust for bits being pointers. (read_ipcp_transformation_info): Likewise. (ipcp_update_bits): Likewise. Fix excessively long lines a trailing space. Include gt-ipa-prop.h. * ipa-cp.c (propagate_bits_across_jump_function): Adjust for bits being pointers. (ipcp_store_bits_results): Likewise. (propagate_vr_across_jump_function): Adjust for m_vr being a pointer. Do not write to existing jump functions but use a temporary instead. From-SVN: r245805
2017-03-01 10:37:27 +01:00
#include "gt-ipa-prop.h"