gcc/gcc/gimple-ssa-strength-reducti...

3840 lines
115 KiB
C
Raw Normal View History

/* Straight-line strength reduction.
Copyright (C) 2012-2017 Free Software Foundation, Inc.
Contributed by Bill Schmidt, IBM <wschmidt@linux.ibm.com>
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/>. */
/* There are many algorithms for performing strength reduction on
loops. This is not one of them. IVOPTS handles strength reduction
of induction variables just fine. This pass is intended to pick
up the crumbs it leaves behind, by considering opportunities for
strength reduction along dominator paths.
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
Strength reduction addresses explicit multiplies, and certain
multiplies implicit in addressing expressions. It would also be
possible to apply strength reduction to divisions and modulos,
but such opportunities are relatively uncommon.
Strength reduction is also currently restricted to integer operations.
If desired, it could be extended to floating-point operations under
control of something like -funsafe-math-optimizations. */
#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 "cfghooks.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 "expmed.h"
#include "gimple-pretty-print.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-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"
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 "cfgloop.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 "domwalk.h"
#include "params.h"
tree-ssa.h: Don't include gimple-low.h... * tree-ssa.h: Don't include gimple-low.h, tree-ssa-address.h, sbitmap.h, tree-ssa-threadedge.h, tree-ssa-dom.h, and tree-cfgcleanup.h. * gimple-low.c (gimple_check_call_arg, gimple_check_call_matching_types): Move to cgraph.c. * gimple-low.h: Remove prototype. * cgraph.c: (gimple_check_call_arg, gimple_check_call_matching_types): Relocate from gimple-low.c. * cgraph.h: Add prototype. Don't include basic-block.h. * gimplify.c: Add gimple-low to include list. * omp-low.c: Add gimple-low and tree-cfgcleanup.h to include list. * tree-eh.c: Add gimple-low to include list. * tree-nested.c: Likewise. * cfgexpand.c: Add tree-ssa-address.h to include list. * expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * trans-mem.c: Likewise. * tree-mudflap.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-dom.c: Include tree-ssa-threadedge.h and tree-ssa-dom.h. (degenerate_phi_result): Move to tree-phinodes.c. * tree-ssa-loop-ch.c: Include tree-ssa-threadedge.h. * tree-ssa-threadedge.c: Likewise. * tree-vrp.c: Likewise. * tree-phinodes.c (degenerate_phi_result): Relocate here. * tree-ssa-dom.h (degenerate_phi_result): Remove Prototype. * tree-phinodes.h (degenerate_phi_result): Add prototype. * tree-ssa-copy.c: Include tree-ssa-dom.h. * tree-ssa-forwprop.c: Likewise. * tree-cfgcleanup.c (execute_cleanup_cfg_post_optimizing, pass_data_cleanup_cfg_post_optimizing, make_pass_cleanup_cfg_post_optimizing): Relocate from tree-optimize.c. * tree-optimize.c: Delete File. * graphite.c: Include tree-cfgcleanup.h. * passes.c: Likewise. * tree-cfg.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-switch-conversion.c: Don't include tree-ssa-operands.h. * tree-outof-ssa.c: Include sbitmap.h. * tree-ssa-live.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-stdarg.c: Likewise. * Makefile.in (OBJS): Delete tree-optimize.o. * basic-block.h (gcov_type, gcov_type_unsigned): Move to coretypes.h. * coretypes.h (gcov_type, gcov_type_unsigned): Relocate here. * varasm.c: Include basic-block.h. * cfgloop.h: Include function.h instead of basic-block.h (bb_loop_depth): Move to cfgloop.c. * cfgloop.c (bb_loop_depth): Relocate from cfgloop.h. From-SVN: r203833
2013-10-18 21:35:40 +02:00
#include "tree-ssa-address.h"
#include "tree-affine.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"
/* Information about a strength reduction candidate. Each statement
in the candidate table represents an expression of one of the
following forms (the special case of CAND_REF will be described
later):
(CAND_MULT) S1: X = (B + i) * S
(CAND_ADD) S1: X = B + (i * S)
Here X and B are SSA names, i is an integer constant, and S is
either an SSA name or a constant. We call B the "base," i the
"index", and S the "stride."
Any statement S0 that dominates S1 and is of the form:
(CAND_MULT) S0: Y = (B + i') * S
(CAND_ADD) S0: Y = B + (i' * S)
is called a "basis" for S1. In both cases, S1 may be replaced by
S1': X = Y + (i - i') * S,
where (i - i') * S is folded to the extent possible.
All gimple statements are visited in dominator order, and each
statement that may contribute to one of the forms of S1 above is
given at least one entry in the candidate table. Such statements
include addition, pointer addition, subtraction, multiplication,
negation, copies, and nontrivial type casts. If a statement may
represent more than one expression of the forms of S1 above,
multiple "interpretations" are stored in the table and chained
together. Examples:
* An add of two SSA names may treat either operand as the base.
* A multiply of two SSA names, likewise.
* A copy or cast may be thought of as either a CAND_MULT with
i = 0 and S = 1, or as a CAND_ADD with i = 0 or S = 0.
Candidate records are allocated from an obstack. They are addressed
both from a hash table keyed on S1, and from a vector of candidate
pointers arranged in predominator order.
Opportunity note
----------------
Currently we don't recognize:
S0: Y = (S * i') - B
S1: X = (S * i) - B
as a strength reduction opportunity, even though this S1 would
also be replaceable by the S1' above. This can be added if it
comes up in practice.
Strength reduction in addressing
--------------------------------
There is another kind of candidate known as CAND_REF. A CAND_REF
describes a statement containing a memory reference having
complex addressing that might benefit from strength reduction.
Specifically, we are interested in references for which
get_inner_reference returns a base address, offset, and bitpos as
follows:
base: MEM_REF (T1, C1)
offset: MULT_EXPR (PLUS_EXPR (T2, C2), C3)
bitpos: C4 * BITS_PER_UNIT
Here T1 and T2 are arbitrary trees, and C1, C2, C3, C4 are
arbitrary integer constants. Note that C2 may be zero, in which
case the offset will be MULT_EXPR (T2, C3).
When this pattern is recognized, the original memory reference
can be replaced with:
MEM_REF (POINTER_PLUS_EXPR (T1, MULT_EXPR (T2, C3)),
C1 + (C2 * C3) + C4)
which distributes the multiply to allow constant folding. When
two or more addressing expressions can be represented by MEM_REFs
of this form, differing only in the constants C1, C2, and C4,
making this substitution produces more efficient addressing during
the RTL phases. When there are not at least two expressions with
the same values of T1, T2, and C3, there is nothing to be gained
by the replacement.
Strength reduction of CAND_REFs uses the same infrastructure as
that used by CAND_MULTs and CAND_ADDs. We record T1 in the base (B)
field, MULT_EXPR (T2, C3) in the stride (S) field, and
C1 + (C2 * C3) + C4 in the index (i) field. A basis for a CAND_REF
is thus another CAND_REF with the same B and S values. When at
least two CAND_REFs are chained together using the basis relation,
each of them is replaced as above, resulting in improved code
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
generation for addressing.
Conditional candidates
======================
Conditional candidates are best illustrated with an example.
Consider the code sequence:
(1) x_0 = ...;
(2) a_0 = x_0 * 5; MULT (B: x_0; i: 0; S: 5)
if (...)
(3) x_1 = x_0 + 1; ADD (B: x_0, i: 1; S: 1)
(4) x_2 = PHI <x_0, x_1>; PHI (B: x_0, i: 0, S: 1)
(5) x_3 = x_2 + 1; ADD (B: x_2, i: 1, S: 1)
(6) a_1 = x_3 * 5; MULT (B: x_2, i: 1; S: 5)
Here strength reduction is complicated by the uncertain value of x_2.
A legitimate transformation is:
(1) x_0 = ...;
(2) a_0 = x_0 * 5;
if (...)
{
(3) [x_1 = x_0 + 1;]
(3a) t_1 = a_0 + 5;
}
(4) [x_2 = PHI <x_0, x_1>;]
(4a) t_2 = PHI <a_0, t_1>;
(5) [x_3 = x_2 + 1;]
(6r) a_1 = t_2 + 5;
where the bracketed instructions may go dead.
To recognize this opportunity, we have to observe that statement (6)
has a "hidden basis" (2). The hidden basis is unlike a normal basis
in that the statement and the hidden basis have different base SSA
names (x_2 and x_0, respectively). The relationship is established
when a statement's base name (x_2) is defined by a phi statement (4),
each argument of which (x_0, x_1) has an identical "derived base name."
If the argument is defined by a candidate (as x_1 is by (3)) that is a
CAND_ADD having a stride of 1, the derived base name of the argument is
the base name of the candidate (x_0). Otherwise, the argument itself
is its derived base name (as is the case with argument x_0).
The hidden basis for statement (6) is the nearest dominating candidate
whose base name is the derived base name (x_0) of the feeding phi (4),
and whose stride is identical to that of the statement. We can then
create the new "phi basis" (4a) and feeding adds along incoming arcs (3a),
allowing the final replacement of (6) by the strength-reduced (6r).
To facilitate this, a new kind of candidate (CAND_PHI) is introduced.
A CAND_PHI is not a candidate for replacement, but is maintained in the
candidate table to ease discovery of hidden bases. Any phi statement
whose arguments share a common derived base name is entered into the
table with the derived base name, an (arbitrary) index of zero, and a
stride of 1. A statement with a hidden basis can then be detected by
simply looking up its feeding phi definition in the candidate table,
extracting the derived base name, and searching for a basis in the
usual manner after substituting the derived base name.
Note that the transformation is only valid when the original phi and
the statements that define the phi's arguments are all at the same
position in the loop hierarchy. */
/* Index into the candidate vector, offset by 1. VECs are zero-based,
while cand_idx's are one-based, with zero indicating null. */
typedef unsigned cand_idx;
/* The kind of candidate. */
enum cand_kind
{
CAND_MULT,
CAND_ADD,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
CAND_REF,
CAND_PHI
};
struct slsr_cand_d
{
/* The candidate statement S1. */
gimple *cand_stmt;
/* The base expression B: often an SSA name, but not always. */
tree base_expr;
/* The stride S. */
tree stride;
/* The index constant i. */
2014-05-06 18:25:05 +02:00
widest_int index;
/* The type of the candidate. This is normally the type of base_expr,
but casts may have occurred when combining feeding instructions.
A candidate can only be a basis for candidates of the same final type.
(For CAND_REFs, this is the type to be used for operand 1 of the
replacement MEM_REF.) */
tree cand_type;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
/* The type to be used to interpret the stride field when the stride
is not a constant. Normally the same as the type of the recorded
stride, but when the stride has been cast we need to maintain that
knowledge in order to make legal substitutions without losing
precision. When the stride is a constant, this will be sizetype. */
tree stride_type;
/* The kind of candidate (CAND_MULT, etc.). */
enum cand_kind kind;
/* Index of this candidate in the candidate vector. */
cand_idx cand_num;
/* Index of the next candidate record for the same statement.
A statement may be useful in more than one way (e.g., due to
commutativity). So we can have multiple "interpretations"
of a statement. */
cand_idx next_interp;
/* Index of the basis statement S0, if any, in the candidate vector. */
cand_idx basis;
/* First candidate for which this candidate is a basis, if one exists. */
cand_idx dependent;
/* Next candidate having the same basis as this one. */
cand_idx sibling;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* If this is a conditional candidate, the CAND_PHI candidate
that defines the base SSA name B. */
cand_idx def_phi;
/* Savings that can be expected from eliminating dead code if this
candidate is replaced. */
int dead_savings;
};
typedef struct slsr_cand_d slsr_cand, *slsr_cand_t;
typedef const struct slsr_cand_d *const_slsr_cand_t;
/* Pointers to candidates are chained together as part of a mapping
from base expressions to the candidates that use them. */
struct cand_chain_d
{
/* Base expression for the chain of candidates: often, but not
always, an SSA name. */
tree base_expr;
/* Pointer to a candidate. */
slsr_cand_t cand;
/* Chain pointer. */
struct cand_chain_d *next;
};
typedef struct cand_chain_d cand_chain, *cand_chain_t;
typedef const struct cand_chain_d *const_cand_chain_t;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Information about a unique "increment" associated with candidates
having an SSA name for a stride. An increment is the difference
between the index of the candidate and the index of its basis,
i.e., (i - i') as discussed in the module commentary.
When we are not going to generate address arithmetic we treat
increments that differ only in sign as the same, allowing sharing
of the cost of initializers. The absolute value of the increment
is stored in the incr_info. */
struct incr_info_d
{
/* The increment that relates a candidate to its basis. */
2014-05-06 18:25:05 +02:00
widest_int incr;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* How many times the increment occurs in the candidate tree. */
unsigned count;
/* Cost of replacing candidates using this increment. Negative and
zero costs indicate replacement should be performed. */
int cost;
/* If this increment is profitable but is not -1, 0, or 1, it requires
an initializer T_0 = stride * incr to be found or introduced in the
nearest common dominator of all candidates. This field holds T_0
for subsequent use. */
tree initializer;
/* If the initializer was found to already exist, this is the block
where it was found. */
basic_block init_bb;
};
typedef struct incr_info_d incr_info, *incr_info_t;
/* Candidates are maintained in a vector. If candidate X dominates
candidate Y, then X appears before Y in the vector; but the
converse does not necessarily hold. */
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
static vec<slsr_cand_t> cand_vec;
enum cost_consts
{
COST_NEUTRAL = 0,
COST_INFINITE = 1000
};
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
enum stride_status
{
UNKNOWN_STRIDE = 0,
KNOWN_STRIDE = 1
};
enum phi_adjust_status
{
NOT_PHI_ADJUST = 0,
PHI_ADJUST = 1
};
enum count_phis_status
{
DONT_COUNT_PHIS = 0,
COUNT_PHIS = 1
};
/* Pointer map embodying a mapping from statements to candidates. */
static hash_map<gimple *, slsr_cand_t> *stmt_cand_map;
/* Obstack for candidates. */
static struct obstack cand_obstack;
/* Obstack for candidate chains. */
static struct obstack chain_obstack;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* An array INCR_VEC of incr_infos is used during analysis of related
candidates having an SSA name for a stride. INCR_VEC_LEN describes
its current length. MAX_INCR_VEC_LEN is used to avoid costly
pathological cases. */
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
static incr_info_t incr_vec;
static unsigned incr_vec_len;
const int MAX_INCR_VEC_LEN = 16;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* For a chain of candidates with unknown stride, indicates whether or not
we must generate pointer arithmetic when replacing statements. */
static bool address_arithmetic_p;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Forward function declarations. */
static slsr_cand_t base_cand_from_table (tree);
static tree introduce_cast_before_cand (slsr_cand_t, tree, tree);
static bool legal_cast_p_1 (tree, tree);
/* Produce a pointer to the IDX'th candidate in the candidate vector. */
static slsr_cand_t
lookup_cand (cand_idx idx)
{
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
return cand_vec[idx - 1];
}
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
/* Helper for hashing a candidate chain header. */
hash-table.h: Update comments. gcc/ * hash-table.h: Update comments. * hash-traits.h (pointer_hash): Don't inherit from typed_noop_remove. (nofree_ptr_hash): New class. * asan.c (asan_mem_ref_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. * attribs.c (attribute_hasher): Likewise. * cfg.c (bb_copy_hasher): Likewise. * cselib.c (cselib_hasher): Likewise. * dse.c (invariant_group_base_hasher): Likewise. * dwarf2cfi.c (trace_info_hasher): Likewise. * dwarf2out.c (macinfo_entry_hasher): Likewise. (comdat_type_hasher, loc_list_hasher): Likewise. * gcse.c (pre_ldst_expr_hasher): Likewise. * genmatch.c (id_base): Likewise. * genrecog.c (test_pattern_hasher): Likewise. * gimple-ssa-strength-reduction.c (cand_chain_hasher): Likewise. * haifa-sched.c (delay_i1_hasher): Likewise. * hard-reg-set.h (simplifiable_subregs_hasher): Likewise. * ipa-icf.h (congruence_class_group_hash): Likewise. * ipa-profile.c (histogram_hash): Likewise. * ira-color.c (allocno_hard_regs_hasher): Likewise. * lto-streamer.h (string_slot_hasher): Likewise. * lto-streamer.c (tree_entry_hasher): Likewise. * plugin.c (event_hasher): Likewise. * postreload-gcse.c (expr_hasher): Likewise. * store-motion.c (st_expr_hasher): Likewise. * tree-sra.c (uid_decl_hasher): Likewise. * tree-ssa-coalesce.c (coalesce_pair_hasher): Likewise. (ssa_name_var_hash): Likewise. * tree-ssa-live.c (tree_int_map_hasher): Likewise. * tree-ssa-loop-im.c (mem_ref_hasher): Likewise. * tree-ssa-pre.c (pre_expr_d): Likewise. * tree-ssa-sccvn.c (vn_nary_op_hasher): Likewise. * vtable-verify.h (registration_hasher): Likewise. * vtable-verify.c (vtbl_map_hasher): Likewise. * config/arm/arm.c (libcall_hasher): Likewise. * config/i386/winnt.c (wrapped_symbol_hasher): Likewise. * config/ia64/ia64.c (bundle_state_hasher): Likewise. * config/sol2.c (comdat_entry_hasher): Likewise. * fold-const.c (fold): Use nofree_ptr_hash instead of pointer_hash. (print_fold_checksum, fold_checksum_tree): Likewise. (debug_fold_checksum, fold_build1_stat_loc): Likewise. (fold_build2_stat_loc, fold_build3_stat_loc): Likewise. (fold_build_call_array_loc): Likewise. * tree-ssa-ccp.c (gimple_htab): Likewise. * tree-browser.c (tree_upper_hasher): Inherit from nofree_ptr_hash rather than pointer_type. gcc/c/ * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash instead of pointer_hash. (detect_field_duplicates): Likewise. gcc/cp/ * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash rather than pointer_hash. (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash. * semantics.c (nrv_data): Likewise. * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise. gcc/java/ * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/lto/ * lto.c (tree_scc_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/objc/ * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. libcc1/ * plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. (plugin_context): Use nofree_ptr_hash rather than pointer_hash. (plugin_context::mark): Likewise. From-SVN: r224957
2015-06-25 19:06:13 +02:00
struct cand_chain_hasher : nofree_ptr_hash <cand_chain>
{
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
static inline hashval_t hash (const cand_chain *);
static inline bool equal (const cand_chain *, const cand_chain *);
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
};
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
inline hashval_t
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
cand_chain_hasher::hash (const cand_chain *p)
{
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
tree base_expr = p->base_expr;
return iterative_hash_expr (base_expr, 0);
}
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
inline bool
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
cand_chain_hasher::equal (const cand_chain *chain1, const cand_chain *chain2)
{
return operand_equal_p (chain1->base_expr, chain2->base_expr, 0);
}
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
/* Hash table embodying a mapping from base exprs to chains of candidates. */
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
static hash_table<cand_chain_hasher> *base_cand_map;
/* Pointer map used by tree_to_aff_combination_expand. */
static hash_map<tree, name_expansion *> *name_expansions;
/* Pointer map embodying a mapping from bases to alternative bases. */
static hash_map<tree, tree> *alt_base_map;
/* Given BASE, use the tree affine combiniation facilities to
find the underlying tree expression for BASE, with any
immediate offset excluded.
N.B. we should eliminate this backtracking with better forward
analysis in a future release. */
static tree
get_alternative_base (tree base)
{
tree *result = alt_base_map->get (base);
if (result == NULL)
{
tree expr;
aff_tree aff;
tree_to_aff_combination_expand (base, TREE_TYPE (base),
&aff, &name_expansions);
2014-05-06 18:25:05 +02:00
aff.offset = 0;
expr = aff_combination_to_tree (&aff);
gcc_assert (!alt_base_map->put (base, base == expr ? NULL : expr));
return expr == base ? NULL : expr;
}
return *result;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Look in the candidate table for a CAND_PHI that defines BASE and
return it if found; otherwise return NULL. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
static cand_idx
find_phi_def (tree base)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
slsr_cand_t c;
if (TREE_CODE (base) != SSA_NAME)
return 0;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
c = base_cand_from_table (base);
if (!c || c->kind != CAND_PHI
|| SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_phi_result (c->cand_stmt)))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return 0;
return c->cand_num;
}
/* Helper routine for find_basis_for_candidate. May be called twice:
once for the candidate's base expr, and optionally again either for
the candidate's phi definition or for a CAND_REF's alternative base
expression. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
static slsr_cand_t
find_basis_for_base_expr (slsr_cand_t c, tree base_expr)
{
cand_chain mapping_key;
cand_chain_t chain;
slsr_cand_t basis = NULL;
// Limit potential of N^2 behavior for long candidate chains.
int iters = 0;
int max_iters = PARAM_VALUE (PARAM_MAX_SLSR_CANDIDATE_SCAN);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
mapping_key.base_expr = base_expr;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
chain = base_cand_map->find (&mapping_key);
for (; chain && iters < max_iters; chain = chain->next, ++iters)
{
slsr_cand_t one_basis = chain->cand;
if (one_basis->kind != c->kind
|| one_basis->cand_stmt == c->cand_stmt
|| !operand_equal_p (one_basis->stride, c->stride, 0)
|| !types_compatible_p (one_basis->cand_type, c->cand_type)
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
|| !types_compatible_p (one_basis->stride_type, c->stride_type)
|| !dominated_by_p (CDI_DOMINATORS,
gimple_bb (c->cand_stmt),
gimple_bb (one_basis->cand_stmt)))
continue;
tree lhs = gimple_assign_lhs (one_basis->cand_stmt);
if (lhs && TREE_CODE (lhs) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
continue;
if (!basis || basis->cand_num < one_basis->cand_num)
basis = one_basis;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return basis;
}
/* Use the base expr from candidate C to look for possible candidates
that can serve as a basis for C. Each potential basis must also
appear in a block that dominates the candidate statement and have
the same stride and type. If more than one possible basis exists,
the one with highest index in the vector is chosen; this will be
the most immediately dominating basis. */
static int
find_basis_for_candidate (slsr_cand_t c)
{
slsr_cand_t basis = find_basis_for_base_expr (c, c->base_expr);
/* If a candidate doesn't have a basis using its base expression,
it may have a basis hidden by one or more intervening phis. */
if (!basis && c->def_phi)
{
basic_block basis_bb, phi_bb;
slsr_cand_t phi_cand = lookup_cand (c->def_phi);
basis = find_basis_for_base_expr (c, phi_cand->base_expr);
if (basis)
{
/* A hidden basis must dominate the phi-definition of the
candidate's base name. */
phi_bb = gimple_bb (phi_cand->cand_stmt);
basis_bb = gimple_bb (basis->cand_stmt);
if (phi_bb == basis_bb
|| !dominated_by_p (CDI_DOMINATORS, phi_bb, basis_bb))
{
basis = NULL;
c->basis = 0;
}
/* If we found a hidden basis, estimate additional dead-code
savings if the phi and its feeding statements can be removed. */
if (basis && has_single_use (gimple_phi_result (phi_cand->cand_stmt)))
c->dead_savings += phi_cand->dead_savings;
}
}
if (flag_expensive_optimizations && !basis && c->kind == CAND_REF)
{
tree alt_base_expr = get_alternative_base (c->base_expr);
if (alt_base_expr)
basis = find_basis_for_base_expr (c, alt_base_expr);
}
if (basis)
{
c->sibling = basis->dependent;
basis->dependent = c->cand_num;
return basis->cand_num;
}
return 0;
}
/* Record a mapping from BASE to C, indicating that C may potentially serve
as a basis using that base expression. BASE may be the same as
C->BASE_EXPR; alternatively BASE can be a different tree that share the
underlining expression of C->BASE_EXPR. */
static void
record_potential_basis (slsr_cand_t c, tree base)
{
cand_chain_t node;
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
cand_chain **slot;
gcc_assert (base);
node = (cand_chain_t) obstack_alloc (&chain_obstack, sizeof (cand_chain));
node->base_expr = base;
node->cand = c;
node->next = NULL;
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
slot = base_cand_map->find_slot (node, INSERT);
if (*slot)
{
cand_chain_t head = (cand_chain_t) (*slot);
node->next = head->next;
head->next = node;
}
else
*slot = node;
}
/* Allocate storage for a new candidate and initialize its fields.
Attempt to find a basis for the candidate.
For CAND_REF, an alternative base may also be recorded and used
to find a basis. This helps cases where the expression hidden
behind BASE (which is usually an SSA_NAME) has immediate offset,
e.g.
a2[i][j] = 1;
a2[i + 20][j] = 2; */
static slsr_cand_t
alloc_cand_and_find_basis (enum cand_kind kind, gimple *gs, tree base,
2014-05-06 18:25:05 +02:00
const widest_int &index, tree stride, tree ctype,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
tree stype, unsigned savings)
{
slsr_cand_t c = (slsr_cand_t) obstack_alloc (&cand_obstack,
sizeof (slsr_cand));
c->cand_stmt = gs;
c->base_expr = base;
c->stride = stride;
c->index = index;
c->cand_type = ctype;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
c->stride_type = stype;
c->kind = kind;
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
c->cand_num = cand_vec.length () + 1;
c->next_interp = 0;
c->dependent = 0;
c->sibling = 0;
c->def_phi = kind == CAND_MULT ? find_phi_def (base) : 0;
c->dead_savings = savings;
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
cand_vec.safe_push (c);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (kind == CAND_PHI)
c->basis = 0;
else
c->basis = find_basis_for_candidate (c);
record_potential_basis (c, base);
if (flag_expensive_optimizations && kind == CAND_REF)
{
tree alt_base = get_alternative_base (base);
if (alt_base)
record_potential_basis (c, alt_base);
}
return c;
}
/* Determine the target cost of statement GS when compiling according
to SPEED. */
static int
stmt_cost (gimple *gs, bool speed)
{
tree lhs, rhs1, rhs2;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode lhs_mode;
gcc_assert (is_gimple_assign (gs));
lhs = gimple_assign_lhs (gs);
rhs1 = gimple_assign_rhs1 (gs);
lhs_mode = TYPE_MODE (TREE_TYPE (lhs));
switch (gimple_assign_rhs_code (gs))
{
case MULT_EXPR:
rhs2 = gimple_assign_rhs2 (gs);
cuintp.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/ada/ * gcc-interface/cuintp.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/c-family/ * c-ada-spec.c, c-common.c, c-format.c, c-pretty-print.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/c/ * c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/cp/ * error.c, init.c, parser.c, semantics.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/go/ * gofrontend/expressions.cc: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/java/ * class.c, expr.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. gcc/ * builtins.c, config/alpha/alpha.c, config/c6x/predicates.md, config/ia64/predicates.md, config/iq2000/iq2000.c, config/mips/mips.c, config/s390/s390.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c, expr.h, fold-const.c, gimple-fold.c, gimple-ssa-strength-reduction.c, gimple.c, godump.c, graphite-scop-detection.c, graphite-sese-to-poly.c, omp-low.c, predict.c, rtlanal.c, sdbout.c, simplify-rtx.c, stor-layout.c, tree-data-ref.c, tree-dfa.c, tree-pretty-print.c, tree-sra.c, tree-ssa-alias.c, tree-ssa-forwprop.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-phiopt.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-vect-data-refs.c, tree-vect-patterns.c, tree-vectorizer.h, tree.c, var-tracking.c, varasm.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout. From-SVN: r204955
2013-11-18 15:51:10 +01:00
if (tree_fits_shwi_p (rhs2))
cuintp.c (UI_From_gnu): Use tree_to_shwi. gcc/ada/ 2013-11-19 Kenneth Zadeck <zadeck@naturalbridge.com> Mike Stump <mikestump@comcast.net> Richard Sandiford <rdsandiford@googlemail.com> * gcc-interface/cuintp.c (UI_From_gnu): Use tree_to_shwi. * gcc-interface/decl.c (gnat_to_gnu_entity): Use tree_to_uhwi. * gcc-interface/utils.c (make_packable_type): Likewise. gcc/c-family/ 2013-11-19 Kenneth Zadeck <zadeck@naturalbridge.com> Mike Stump <mikestump@comcast.net> Richard Sandiford <rdsandiford@googlemail.com> * c-ada-spec.c (is_simple_enum): Use tree_to_shwi and tree_to_uhwi instead of TREE_INT_CST_LOW, in cases where there is a protecting tree_fits_shwi_p or tree_fits_uhwi_p. (dump_generic_ada_node): Likewise. * c-format.c (check_format_arg): Likewise. * c-pretty-print.c (pp_c_integer_constant): Likewise. gcc/ 2013-11-19 Kenneth Zadeck <zadeck@naturalbridge.com> Mike Stump <mikestump@comcast.net> Richard Sandiford <rdsandiford@googlemail.com> * alias.c (ao_ref_from_mem): Use tree_to_shwi and tree_to_uhwi instead of TREE_INT_CST_LOW, in cases where there is a protecting tree_fits_shwi_p or tree_fits_uhwi_p. * builtins.c (fold_builtin_powi): Likewise. * config/epiphany/epiphany.c (epiphany_special_round_type_align): Likewise. * dbxout.c (dbxout_symbol): Likewise. * expr.c (expand_expr_real_1): Likewise. * fold-const.c (fold_single_bit_test, fold_plusminus_mult_expr) (fold_binary_loc): Likewise. * gimple-fold.c (fold_const_aggregate_ref_1): Likewise. * gimple-ssa-strength-reduction.c (stmt_cost): Likewise. * omp-low.c (lower_omp_for_lastprivate): Likewise. * simplify-rtx.c (delegitimize_mem_from_attrs): Likewise. * stor-layout.c (compute_record_mode): Likewise. * tree-cfg.c (verify_expr): Likewise. * tree-dfa.c (get_ref_base_and_extent): Likewise. * tree-pretty-print.c (dump_array_domain): Likewise. * tree-sra.c (build_user_friendly_ref_for_offset): Likewise. * tree-ssa-ccp.c (fold_builtin_alloca_with_align): Likewise. * tree-ssa-loop-ivopts.c (get_loop_invariant_expr_id): Likewise. * tree-ssa-math-opts.c (execute_cse_sincos): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (acceptable_pow_call): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. (ao_ref_init_from_vn_reference, vn_reference_fold_indirect): Likewise. (vn_reference_lookup_3, simplify_binary_expression): Likewise. * tree-ssa-structalias.c (bitpos_of_field): Likewise. (get_constraint_for_1, push_fields_onto_fieldstack): Likewise. (create_variable_info_for_1): Likewise. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise. (vect_verify_datarefs_alignment): Likewise. (vect_analyze_data_ref_accesses): Likewise. (vect_prune_runtime_alias_test_list): Likewise. * tree-vectorizer.h (NITERS_KNOWN_P): Likewise. Co-Authored-By: Mike Stump <mikestump@comcast.net> Co-Authored-By: Richard Sandiford <rdsandiford@googlemail.com> From-SVN: r205103
2013-11-20 12:57:27 +01:00
return mult_by_coeff_cost (tree_to_shwi (rhs2), lhs_mode, speed);
gcc_assert (TREE_CODE (rhs1) != INTEGER_CST);
return mul_cost (speed, lhs_mode);
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
case MINUS_EXPR:
return add_cost (speed, lhs_mode);
case NEGATE_EXPR:
return neg_cost (speed, lhs_mode);
CASE_CONVERT:
tree-ssa-loop-ivopts.c (mbc_entry_hash): Remove. 2012-07-26 Bill Schmidt <wschmidt@linux.ibm.com> * tree-ssa-loop-ivopts.c (mbc_entry_hash): Remove. (mbc_entry_eq): Likewise. (mult_costs): Likewise. (cost_tables_exist): Likewise. (initialize_costs): Likewise. (finalize_costs): Likewise. (tree_ssa_iv_optimize_init): Remove call to initialize_costs. (add_regs_cost): Remove. (multiply_regs_cost): Likewise. (add_const_cost): Likewise. (extend_or_trunc_reg_cost): Likewise. (negate_reg_cost): Likewise. (struct mbc_entry): Likewise. (multiply_by_const_cost): Likewise. (get_address_cost): Change add_regs_cost calls to add_cost lookups; change multiply_by_const_cost to mult_by_coeff_cost. (force_expr_to_var_cost): Likewise. (difference_cost): Change multiply_by_const_cost to mult_by_coeff_cost. (get_computation_cost_at): Change add_regs_cost calls to add_cost lookups; change multiply_by_const_cost to mult_by_coeff_cost. (determine_iv_cost): Change add_regs_cost calls to add_cost lookups. (tree_ssa_iv_optimize_finalize): Remove call to finalize_costs. * tree-ssa-address.c (expmed.h): New #include. (most_expensive_mult_to_index): Change multiply_by_const_cost to mult_by_coeff_cost. * gimple-ssa-strength-reduction.c (expmed.h): New #include. (stmt_cost): Change to use mult_by_coeff_cost, mul_cost, add_cost, neg_cost, and convert_cost instead of IVOPTS interfaces. (execute_strength_reduction): Remove calls to initialize_costs and finalize_costs. * expmed.c (struct init_expmed_rtl): Add convert rtx_def. (init_expmed_one_mode): Initialize convert rtx_def; initialize x_convert_cost for related modes. (mult_by_coeff_cost): New function. * expmed.h (NUM_MODE_INT): New #define. (struct target_expmed): Add x_convert_cost matrix. (set_convert_cost): New inline function. (convert_cost): Likewise. (mult_by_coeff_cost): New extern decl. * tree-flow.h (initialize_costs): Remove decl. (finalize_costs): Likewise. (multiply_by_const_cost): Likewise. (add_regs_cost): Likewise. (multiply_regs_cost): Likewise. (add_const_cost): Likewise. (extend_or_trunc_reg_cost): Likewise. (negate_reg_cost): Likewise. * Makefile.in (gimple-ssa-strength-reduction.o): Update dependencies. (tree-ssa-address.o): Update dependencies. From-SVN: r189890
2012-07-26 15:10:04 +02:00
return convert_cost (lhs_mode, TYPE_MODE (TREE_TYPE (rhs1)), speed);
/* Note that we don't assign costs to copies that in most cases
will go away. */
case SSA_NAME:
return 0;
default:
;
}
gcc_unreachable ();
return 0;
}
/* Look up the defining statement for BASE_IN and return a pointer
to its candidate in the candidate table, if any; otherwise NULL.
Only CAND_ADD and CAND_MULT candidates are returned. */
static slsr_cand_t
base_cand_from_table (tree base_in)
{
slsr_cand_t *result;
gimple *def = SSA_NAME_DEF_STMT (base_in);
if (!def)
return (slsr_cand_t) NULL;
result = stmt_cand_map->get (def);
if (result && (*result)->kind != CAND_REF)
return *result;
return (slsr_cand_t) NULL;
}
/* Add an entry to the statement-to-candidate mapping. */
static void
add_cand_for_stmt (gimple *gs, slsr_cand_t c)
{
gcc_assert (!stmt_cand_map->put (gs, c));
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Given PHI which contains a phi statement, determine whether it
satisfies all the requirements of a phi candidate. If so, create
a candidate. Note that a CAND_PHI never has a basis itself, but
is used to help find a basis for subsequent candidates. */
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
slsr_process_phi (gphi *phi, bool speed)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
unsigned i;
tree arg0_base = NULL_TREE, base_type;
slsr_cand_t c;
struct loop *cand_loop = gimple_bb (phi)->loop_father;
unsigned savings = 0;
/* A CAND_PHI requires each of its arguments to have the same
derived base name. (See the module header commentary for a
definition of derived base names.) Furthermore, all feeding
definitions must be in the same position in the loop hierarchy
as PHI. */
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
slsr_cand_t arg_cand;
tree arg = gimple_phi_arg_def (phi, i);
tree derived_base_name = NULL_TREE;
gimple *arg_stmt = NULL;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
basic_block arg_bb = NULL;
if (TREE_CODE (arg) != SSA_NAME)
return;
arg_cand = base_cand_from_table (arg);
if (arg_cand)
{
while (arg_cand->kind != CAND_ADD && arg_cand->kind != CAND_PHI)
{
if (!arg_cand->next_interp)
return;
arg_cand = lookup_cand (arg_cand->next_interp);
}
if (!integer_onep (arg_cand->stride))
return;
derived_base_name = arg_cand->base_expr;
arg_stmt = arg_cand->cand_stmt;
arg_bb = gimple_bb (arg_stmt);
/* Gather potential dead code savings if the phi statement
can be removed later on. */
if (has_single_use (arg))
{
if (gimple_code (arg_stmt) == GIMPLE_PHI)
savings += arg_cand->dead_savings;
else
savings += stmt_cost (arg_stmt, speed);
}
}
else if (SSA_NAME_IS_DEFAULT_DEF (arg))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
derived_base_name = arg;
arg_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun));
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
if (!arg_bb || arg_bb->loop_father != cand_loop)
return;
if (i == 0)
arg0_base = derived_base_name;
else if (!operand_equal_p (derived_base_name, arg0_base, 0))
return;
}
/* Create the candidate. "alloc_cand_and_find_basis" is named
misleadingly for this case, as no basis will be sought for a
CAND_PHI. */
base_type = TREE_TYPE (arg0_base);
2014-05-06 18:25:05 +02:00
c = alloc_cand_and_find_basis (CAND_PHI, phi, arg0_base,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
0, integer_one_node, base_type,
sizetype, savings);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Add the candidate to the statement-candidate mapping. */
add_cand_for_stmt (phi, c);
}
/* Given PBASE which is a pointer to tree, look up the defining
statement for it and check whether the candidate is in the
form of:
X = B + (1 * S), S is integer constant
X = B + (i * S), S is integer one
If so, set PBASE to the candidate's base_expr and return double
int (i * S).
Otherwise, just return double int zero. */
2014-05-06 18:25:05 +02:00
static widest_int
backtrace_base_for_ref (tree *pbase)
{
tree base_in = *pbase;
slsr_cand_t base_cand;
STRIP_NOPS (base_in);
/* Strip off widening conversion(s) to handle cases where
e.g. 'B' is widened from an 'int' in order to calculate
a 64-bit address. */
if (CONVERT_EXPR_P (base_in)
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
&& legal_cast_p_1 (TREE_TYPE (base_in),
TREE_TYPE (TREE_OPERAND (base_in, 0))))
base_in = get_unwidened (base_in, NULL_TREE);
if (TREE_CODE (base_in) != SSA_NAME)
2014-05-06 18:25:05 +02:00
return 0;
base_cand = base_cand_from_table (base_in);
while (base_cand && base_cand->kind != CAND_PHI)
{
if (base_cand->kind == CAND_ADD
2014-05-06 18:25:05 +02:00
&& base_cand->index == 1
&& TREE_CODE (base_cand->stride) == INTEGER_CST)
{
/* X = B + (1 * S), S is integer constant. */
*pbase = base_cand->base_expr;
2014-05-06 18:25:05 +02:00
return wi::to_widest (base_cand->stride);
}
else if (base_cand->kind == CAND_ADD
&& TREE_CODE (base_cand->stride) == INTEGER_CST
&& integer_onep (base_cand->stride))
{
/* X = B + (i * S), S is integer one. */
*pbase = base_cand->base_expr;
return base_cand->index;
}
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
2014-05-06 18:25:05 +02:00
return 0;
}
/* Look for the following pattern:
*PBASE: MEM_REF (T1, C1)
*POFFSET: MULT_EXPR (T2, C3) [C2 is zero]
or
MULT_EXPR (PLUS_EXPR (T2, C2), C3)
or
MULT_EXPR (MINUS_EXPR (T2, -C2), C3)
*PINDEX: C4 * BITS_PER_UNIT
If not present, leave the input values unchanged and return FALSE.
Otherwise, modify the input values as follows and return TRUE:
*PBASE: T1
*POFFSET: MULT_EXPR (T2, C3)
*PINDEX: C1 + (C2 * C3) + C4
When T2 is recorded by a CAND_ADD in the form of (T2' + C5), it
will be further restructured to:
*PBASE: T1
*POFFSET: MULT_EXPR (T2', C3)
*PINDEX: C1 + (C2 * C3) + C4 + (C5 * C3) */
static bool
2014-05-06 18:25:05 +02:00
restructure_reference (tree *pbase, tree *poffset, widest_int *pindex,
tree *ptype)
{
tree base = *pbase, offset = *poffset;
2014-05-06 18:25:05 +02:00
widest_int index = *pindex;
tree mult_op0, t1, t2, type;
widest_int c1, c2, c3, c4, c5;
if (!base
|| !offset
|| TREE_CODE (base) != MEM_REF
|| TREE_CODE (offset) != MULT_EXPR
|| TREE_CODE (TREE_OPERAND (offset, 1)) != INTEGER_CST
2014-05-06 18:25:05 +02:00
|| wi::umod_floor (index, BITS_PER_UNIT) != 0)
return false;
t1 = TREE_OPERAND (base, 0);
2014-05-06 18:25:05 +02:00
c1 = widest_int::from (mem_ref_offset (base), SIGNED);
type = TREE_TYPE (TREE_OPERAND (base, 1));
mult_op0 = TREE_OPERAND (offset, 0);
2014-05-06 18:25:05 +02:00
c3 = wi::to_widest (TREE_OPERAND (offset, 1));
if (TREE_CODE (mult_op0) == PLUS_EXPR)
if (TREE_CODE (TREE_OPERAND (mult_op0, 1)) == INTEGER_CST)
{
t2 = TREE_OPERAND (mult_op0, 0);
2014-05-06 18:25:05 +02:00
c2 = wi::to_widest (TREE_OPERAND (mult_op0, 1));
}
else
return false;
else if (TREE_CODE (mult_op0) == MINUS_EXPR)
if (TREE_CODE (TREE_OPERAND (mult_op0, 1)) == INTEGER_CST)
{
t2 = TREE_OPERAND (mult_op0, 0);
2014-05-06 18:25:05 +02:00
c2 = -wi::to_widest (TREE_OPERAND (mult_op0, 1));
}
else
return false;
else
{
t2 = mult_op0;
2014-05-06 18:25:05 +02:00
c2 = 0;
}
2016-05-02 11:39:38 +02:00
c4 = index >> LOG2_BITS_PER_UNIT;
c5 = backtrace_base_for_ref (&t2);
*pbase = t1;
*poffset = fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, t2),
2014-05-06 18:25:05 +02:00
wide_int_to_tree (sizetype, c3));
*pindex = c1 + c2 * c3 + c4 + c5 * c3;
*ptype = type;
return true;
}
/* Given GS which contains a data reference, create a CAND_REF entry in
the candidate table and attempt to find a basis. */
static void
slsr_process_ref (gimple *gs)
{
tree ref_expr, base, offset, type;
HOST_WIDE_INT bitsize, bitpos;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode;
int unsignedp, reversep, volatilep;
slsr_cand_t c;
if (gimple_vdef (gs))
ref_expr = gimple_assign_lhs (gs);
else
ref_expr = gimple_assign_rhs1 (gs);
if (!handled_component_p (ref_expr)
|| TREE_CODE (ref_expr) == BIT_FIELD_REF
|| (TREE_CODE (ref_expr) == COMPONENT_REF
&& DECL_BIT_FIELD (TREE_OPERAND (ref_expr, 1))))
return;
base = get_inner_reference (ref_expr, &bitsize, &bitpos, &offset, &mode,
Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG. 2016-07-11 Bernd Edlinger <bernd.edlinger@hotmail.de> Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG. * tree-core.h (tree_base::nothrow_flag): Adjust comment. (tree_type_common::lang_flag_7): New. (tree_type_common::spare): Reduce size. * tree.h (TYPE_ALIGN_OK): Remove. (TYPE_LANG_FLAG_7): New. (get_inner_reference): Adjust header. * print-tree.c (print_node): Adjust. * expr.c (get_inner_reference): Remove parameter keep_aligning. (get_bit_range, expand_assignment, expand_expr_addr_expr_1): Adjust calls to get_inner_reference. (expand_expr_real_1): Adjust call to get_inner_reference. Remove handling of TYPE_ALIGN_OK. * builtins.c (get_object_alignment_2): Adjust call to get_inner_reference. Remove handling of VIEW_CONVERT_EXPR. * emit-rtl.c (set_mem_attributes_minus_bitpos): Remove handling of TYPE_ALIGN_OK. * asan.c (instrument_derefs): Adjust calls to get_inner_reference. * cfgexpand.c (expand_debug_expr): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (loc_list_for_address_of_addr_expr_of_indirect_ref, loc_list_from_tree, fortran_common): Likewise. * fold-const.c (optimize_bit_field_compare, decode_field_reference, fold_unary_loc, fold_comparison, split_address_to_core_and_offset): Likewise. * gimple-laddress.c (execute): Likewise. * gimple-ssa-strength-reduction.c (slsr_process_ref): Likewise. * gimplify.c (gimplify_scan_omp_clauses): Likewise. * hsa-gen.c (gen_hsa_addr): Likewise. * simplifx-rtx.c (delegitimize_mem_from_attrs): Likewise. * tsan.c (instrument_expr): Likewise. * ubsan.c (instrument_bool_enum_load, instrument_object_size): Likewise. * tree.c (verify_type_variant): Remove handling of TYPE_ALIGN_OK. * tree-affine.c (tree_to_aff_combination, get_inner_reference_aff): Adjust calls to get_inner_reference. * tree-data-ref.c (split_constant_offset_1, dr_analyze_innermost): Likewise. * tree-scalar-evolution.c (interpret_rhs_expr): Likewise. * tree-sra.c (ipa_sra_check_caller): Likewise. * tree-ssa-loop-ivopts.c (split_address_cost): Likewise. * tree-ssa-math-opts.c (find_bswap_or_nop_load, bswap_replace): Likewise. * tree-vect-data-refs.c (vect_check_gather, vect_analyze_data_refs): Likewise. * config/mips/mips.c (r10k_safe_mem_expr_p): Likewise. * config/pa/pa.c (pa_emit_move_sequence): Remove handling of TYPE_ALIGN_OK. ada: 2016-07-11 Bernd Edlinger <bernd.edlinger@hotmail.de> Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG. * gcc-interface/ada-tree.h (TYPE_ALIGN_OK): Define. * gcc-interface/trans.c (Attribute_to_gnu): Adjust call to get_inner_reference. * gcc-interface/utils2.c (build_unary_op): Likewise. From-SVN: r238210
2016-07-11 17:02:12 +02:00
&unsignedp, &reversep, &volatilep);
if (reversep)
return;
2014-05-06 18:25:05 +02:00
widest_int index = bitpos;
if (!restructure_reference (&base, &offset, &index, &type))
return;
c = alloc_cand_and_find_basis (CAND_REF, gs, base, index, offset,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
type, sizetype, 0);
/* Add the candidate to the statement-candidate mapping. */
add_cand_for_stmt (gs, c);
}
/* Create a candidate entry for a statement GS, where GS multiplies
two SSA names BASE_IN and STRIDE_IN. Propagate any known information
about the two SSA names into the new candidate. Return the new
candidate. */
static slsr_cand_t
create_mul_ssa_cand (gimple *gs, tree base_in, tree stride_in, bool speed)
{
tree base = NULL_TREE, stride = NULL_TREE, ctype = NULL_TREE;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
tree stype = NULL_TREE;
2014-05-06 18:25:05 +02:00
widest_int index;
unsigned savings = 0;
slsr_cand_t c;
slsr_cand_t base_cand = base_cand_from_table (base_in);
/* Look at all interpretations of the base candidate, if necessary,
to find information to propagate into this candidate. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
while (base_cand && !base && base_cand->kind != CAND_PHI)
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (base_cand->kind == CAND_MULT && integer_onep (base_cand->stride))
{
/* Y = (B + i') * 1
X = Y * Z
================
X = (B + i') * Z */
base = base_cand->base_expr;
index = base_cand->index;
stride = stride_in;
ctype = base_cand->cand_type;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = TREE_TYPE (stride_in);
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
else if (base_cand->kind == CAND_ADD
&& TREE_CODE (base_cand->stride) == INTEGER_CST)
{
/* Y = B + (i' * S), S constant
X = Y * Z
============================
X = B + ((i' * S) * Z) */
base = base_cand->base_expr;
2014-05-06 18:25:05 +02:00
index = base_cand->index * wi::to_widest (base_cand->stride);
stride = stride_in;
ctype = base_cand->cand_type;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = TREE_TYPE (stride_in);
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
if (!base)
{
/* No interpretations had anything useful to propagate, so
produce X = (Y + 0) * Z. */
base = base_in;
2014-05-06 18:25:05 +02:00
index = 0;
stride = stride_in;
ctype = TREE_TYPE (base_in);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = TREE_TYPE (stride_in);
}
c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
ctype, stype, savings);
return c;
}
/* Create a candidate entry for a statement GS, where GS multiplies
SSA name BASE_IN by constant STRIDE_IN. Propagate any known
information about BASE_IN into the new candidate. Return the new
candidate. */
static slsr_cand_t
create_mul_imm_cand (gimple *gs, tree base_in, tree stride_in, bool speed)
{
tree base = NULL_TREE, stride = NULL_TREE, ctype = NULL_TREE;
2014-05-06 18:25:05 +02:00
widest_int index, temp;
unsigned savings = 0;
slsr_cand_t c;
slsr_cand_t base_cand = base_cand_from_table (base_in);
/* Look at all interpretations of the base candidate, if necessary,
to find information to propagate into this candidate. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
while (base_cand && !base && base_cand->kind != CAND_PHI)
{
if (base_cand->kind == CAND_MULT
&& TREE_CODE (base_cand->stride) == INTEGER_CST)
{
/* Y = (B + i') * S, S constant
X = Y * c
============================
X = (B + i') * (S * c) */
2014-05-06 18:25:05 +02:00
temp = wi::to_widest (base_cand->stride) * wi::to_widest (stride_in);
if (wi::fits_to_tree_p (temp, TREE_TYPE (stride_in)))
{
base = base_cand->base_expr;
index = base_cand->index;
2014-05-06 18:25:05 +02:00
stride = wide_int_to_tree (TREE_TYPE (stride_in), temp);
ctype = base_cand->cand_type;
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
else if (base_cand->kind == CAND_ADD && integer_onep (base_cand->stride))
{
/* Y = B + (i' * 1)
X = Y * c
===========================
X = (B + i') * c */
base = base_cand->base_expr;
index = base_cand->index;
stride = stride_in;
ctype = base_cand->cand_type;
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
else if (base_cand->kind == CAND_ADD
2014-05-06 18:25:05 +02:00
&& base_cand->index == 1
&& TREE_CODE (base_cand->stride) == INTEGER_CST)
{
/* Y = B + (1 * S), S constant
X = Y * c
===========================
X = (B + S) * c */
base = base_cand->base_expr;
2014-05-06 18:25:05 +02:00
index = wi::to_widest (base_cand->stride);
stride = stride_in;
ctype = base_cand->cand_type;
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
if (!base)
{
/* No interpretations had anything useful to propagate, so
produce X = (Y + 0) * c. */
base = base_in;
2014-05-06 18:25:05 +02:00
index = 0;
stride = stride_in;
ctype = TREE_TYPE (base_in);
}
c = alloc_cand_and_find_basis (CAND_MULT, gs, base, index, stride,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
ctype, sizetype, savings);
return c;
}
/* Given GS which is a multiply of scalar integers, make an appropriate
entry in the candidate table. If this is a multiply of two SSA names,
create two CAND_MULT interpretations and attempt to find a basis for
each of them. Otherwise, create a single CAND_MULT and attempt to
find a basis. */
static void
slsr_process_mul (gimple *gs, tree rhs1, tree rhs2, bool speed)
{
slsr_cand_t c, c2;
/* If this is a multiply of an SSA name with itself, it is highly
unlikely that we will get a strength reduction opportunity, so
don't record it as a candidate. This simplifies the logic for
finding a basis, so if this is removed that must be considered. */
if (rhs1 == rhs2)
return;
if (TREE_CODE (rhs2) == SSA_NAME)
{
/* Record an interpretation of this statement in the candidate table
assuming RHS1 is the base expression and RHS2 is the stride. */
c = create_mul_ssa_cand (gs, rhs1, rhs2, speed);
/* Add the first interpretation to the statement-candidate mapping. */
add_cand_for_stmt (gs, c);
/* Record another interpretation of this statement assuming RHS1
is the stride and RHS2 is the base expression. */
c2 = create_mul_ssa_cand (gs, rhs2, rhs1, speed);
c->next_interp = c2->cand_num;
}
else
{
/* Record an interpretation for the multiply-immediate. */
c = create_mul_imm_cand (gs, rhs1, rhs2, speed);
/* Add the interpretation to the statement-candidate mapping. */
add_cand_for_stmt (gs, c);
}
}
/* Create a candidate entry for a statement GS, where GS adds two
SSA names BASE_IN and ADDEND_IN if SUBTRACT_P is false, and
subtracts ADDEND_IN from BASE_IN otherwise. Propagate any known
information about the two SSA names into the new candidate.
Return the new candidate. */
static slsr_cand_t
create_add_ssa_cand (gimple *gs, tree base_in, tree addend_in,
bool subtract_p, bool speed)
{
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
tree base = NULL_TREE, stride = NULL_TREE, ctype = NULL_TREE;
tree stype = NULL_TREE;
2014-05-06 18:25:05 +02:00
widest_int index;
unsigned savings = 0;
slsr_cand_t c;
slsr_cand_t base_cand = base_cand_from_table (base_in);
slsr_cand_t addend_cand = base_cand_from_table (addend_in);
/* The most useful transformation is a multiply-immediate feeding
an add or subtract. Look for that first. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
while (addend_cand && !base && addend_cand->kind != CAND_PHI)
{
if (addend_cand->kind == CAND_MULT
2014-05-06 18:25:05 +02:00
&& addend_cand->index == 0
&& TREE_CODE (addend_cand->stride) == INTEGER_CST)
{
/* Z = (B + 0) * S, S constant
X = Y +/- Z
===========================
X = Y + ((+/-1 * S) * B) */
base = base_in;
2014-05-06 18:25:05 +02:00
index = wi::to_widest (addend_cand->stride);
if (subtract_p)
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
index = -index;
stride = addend_cand->base_expr;
ctype = TREE_TYPE (base_in);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = addend_cand->cand_type;
if (has_single_use (addend_in))
savings = (addend_cand->dead_savings
+ stmt_cost (addend_cand->cand_stmt, speed));
}
if (addend_cand->next_interp)
addend_cand = lookup_cand (addend_cand->next_interp);
else
addend_cand = NULL;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
while (base_cand && !base && base_cand->kind != CAND_PHI)
{
if (base_cand->kind == CAND_ADD
2014-05-06 18:25:05 +02:00
&& (base_cand->index == 0
|| operand_equal_p (base_cand->stride,
integer_zero_node, 0)))
{
/* Y = B + (i' * S), i' * S = 0
X = Y +/- Z
============================
X = B + (+/-1 * Z) */
base = base_cand->base_expr;
2014-05-06 18:25:05 +02:00
index = subtract_p ? -1 : 1;
stride = addend_in;
ctype = base_cand->cand_type;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = (TREE_CODE (addend_in) == INTEGER_CST ? sizetype
: TREE_TYPE (addend_in));
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
else if (subtract_p)
{
slsr_cand_t subtrahend_cand = base_cand_from_table (addend_in);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
while (subtrahend_cand && !base && subtrahend_cand->kind != CAND_PHI)
{
if (subtrahend_cand->kind == CAND_MULT
2014-05-06 18:25:05 +02:00
&& subtrahend_cand->index == 0
&& TREE_CODE (subtrahend_cand->stride) == INTEGER_CST)
{
/* Z = (B + 0) * S, S constant
X = Y - Z
===========================
Value: X = Y + ((-1 * S) * B) */
base = base_in;
2014-05-06 18:25:05 +02:00
index = wi::to_widest (subtrahend_cand->stride);
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
index = -index;
stride = subtrahend_cand->base_expr;
ctype = TREE_TYPE (base_in);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = subtrahend_cand->cand_type;
if (has_single_use (addend_in))
savings = (subtrahend_cand->dead_savings
+ stmt_cost (subtrahend_cand->cand_stmt, speed));
}
if (subtrahend_cand->next_interp)
subtrahend_cand = lookup_cand (subtrahend_cand->next_interp);
else
subtrahend_cand = NULL;
}
}
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
if (!base)
{
/* No interpretations had anything useful to propagate, so
produce X = Y + (1 * Z). */
base = base_in;
2014-05-06 18:25:05 +02:00
index = subtract_p ? -1 : 1;
stride = addend_in;
ctype = TREE_TYPE (base_in);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = (TREE_CODE (addend_in) == INTEGER_CST ? sizetype
: TREE_TYPE (addend_in));
}
c = alloc_cand_and_find_basis (CAND_ADD, gs, base, index, stride,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
ctype, stype, savings);
return c;
}
/* Create a candidate entry for a statement GS, where GS adds SSA
name BASE_IN to constant INDEX_IN. Propagate any known information
about BASE_IN into the new candidate. Return the new candidate. */
static slsr_cand_t
create_add_imm_cand (gimple *gs, tree base_in, const widest_int &index_in,
2014-05-06 18:25:05 +02:00
bool speed)
{
enum cand_kind kind = CAND_ADD;
tree base = NULL_TREE, stride = NULL_TREE, ctype = NULL_TREE;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
tree stype = NULL_TREE;
2014-05-06 18:25:05 +02:00
widest_int index, multiple;
unsigned savings = 0;
slsr_cand_t c;
slsr_cand_t base_cand = base_cand_from_table (base_in);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
while (base_cand && !base && base_cand->kind != CAND_PHI)
{
2014-05-06 18:25:05 +02:00
signop sign = TYPE_SIGN (TREE_TYPE (base_cand->stride));
if (TREE_CODE (base_cand->stride) == INTEGER_CST
2014-05-06 18:25:05 +02:00
&& wi::multiple_of_p (index_in, wi::to_widest (base_cand->stride),
sign, &multiple))
{
/* Y = (B + i') * S, S constant, c = kS for some integer k
X = Y + c
============================
X = (B + (i'+ k)) * S
OR
Y = B + (i' * S), S constant, c = kS for some integer k
X = Y + c
============================
X = (B + (i'+ k)) * S */
kind = base_cand->kind;
base = base_cand->base_expr;
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
index = base_cand->index + multiple;
stride = base_cand->stride;
ctype = base_cand->cand_type;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = base_cand->stride_type;
if (has_single_use (base_in))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
}
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
if (!base)
{
/* No interpretations had anything useful to propagate, so
produce X = Y + (c * 1). */
kind = CAND_ADD;
base = base_in;
index = index_in;
stride = integer_one_node;
ctype = TREE_TYPE (base_in);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
stype = sizetype;
}
c = alloc_cand_and_find_basis (kind, gs, base, index, stride,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
ctype, stype, savings);
return c;
}
/* Given GS which is an add or subtract of scalar integers or pointers,
make at least one appropriate entry in the candidate table. */
static void
slsr_process_add (gimple *gs, tree rhs1, tree rhs2, bool speed)
{
bool subtract_p = gimple_assign_rhs_code (gs) == MINUS_EXPR;
slsr_cand_t c = NULL, c2;
if (TREE_CODE (rhs2) == SSA_NAME)
{
/* First record an interpretation assuming RHS1 is the base expression
and RHS2 is the stride. But it doesn't make sense for the
stride to be a pointer, so don't record a candidate in that case. */
if (!POINTER_TYPE_P (TREE_TYPE (rhs2)))
{
c = create_add_ssa_cand (gs, rhs1, rhs2, subtract_p, speed);
/* Add the first interpretation to the statement-candidate
mapping. */
add_cand_for_stmt (gs, c);
}
/* If the two RHS operands are identical, or this is a subtract,
we're done. */
if (operand_equal_p (rhs1, rhs2, 0) || subtract_p)
return;
/* Otherwise, record another interpretation assuming RHS2 is the
base expression and RHS1 is the stride, again provided that the
stride is not a pointer. */
if (!POINTER_TYPE_P (TREE_TYPE (rhs1)))
{
c2 = create_add_ssa_cand (gs, rhs2, rhs1, false, speed);
if (c)
c->next_interp = c2->cand_num;
else
add_cand_for_stmt (gs, c2);
}
}
else
{
/* Record an interpretation for the add-immediate. */
2014-05-06 18:25:05 +02:00
widest_int index = wi::to_widest (rhs2);
if (subtract_p)
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
index = -index;
c = create_add_imm_cand (gs, rhs1, index, speed);
/* Add the interpretation to the statement-candidate mapping. */
add_cand_for_stmt (gs, c);
}
}
/* Given GS which is a negate of a scalar integer, make an appropriate
entry in the candidate table. A negate is equivalent to a multiply
by -1. */
static void
slsr_process_neg (gimple *gs, tree rhs1, bool speed)
{
/* Record a CAND_MULT interpretation for the multiply by -1. */
slsr_cand_t c = create_mul_imm_cand (gs, rhs1, integer_minus_one_node, speed);
/* Add the interpretation to the statement-candidate mapping. */
add_cand_for_stmt (gs, c);
}
/* Help function for legal_cast_p, operating on two trees. Checks
whether it's allowable to cast from RHS to LHS. See legal_cast_p
for more details. */
static bool
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
legal_cast_p_1 (tree lhs_type, tree rhs_type)
{
unsigned lhs_size, rhs_size;
bool lhs_wraps, rhs_wraps;
lhs_size = TYPE_PRECISION (lhs_type);
rhs_size = TYPE_PRECISION (rhs_type);
lhs_wraps = ANY_INTEGRAL_TYPE_P (lhs_type) && TYPE_OVERFLOW_WRAPS (lhs_type);
rhs_wraps = ANY_INTEGRAL_TYPE_P (rhs_type) && TYPE_OVERFLOW_WRAPS (rhs_type);
if (lhs_size < rhs_size
|| (rhs_wraps && !lhs_wraps)
|| (rhs_wraps && lhs_wraps && rhs_size != lhs_size))
return false;
return true;
}
/* Return TRUE if GS is a statement that defines an SSA name from
a conversion and is legal for us to combine with an add and multiply
in the candidate table. For example, suppose we have:
A = B + i;
C = (type) A;
D = C * S;
Without the type-cast, we would create a CAND_MULT for D with base B,
index i, and stride S. We want to record this candidate only if it
is equivalent to apply the type cast following the multiply:
A = B + i;
E = A * S;
D = (type) E;
We will record the type with the candidate for D. This allows us
to use a similar previous candidate as a basis. If we have earlier seen
A' = B + i';
C' = (type) A';
D' = C' * S;
we can replace D with
D = D' + (i - i') * S;
But if moving the type-cast would change semantics, we mustn't do this.
This is legitimate for casts from a non-wrapping integral type to
any integral type of the same or larger size. It is not legitimate
to convert a wrapping type to a non-wrapping type, or to a wrapping
type of a different size. I.e., with a wrapping type, we must
assume that the addition B + i could wrap, in which case performing
the multiply before or after one of the "illegal" type casts will
have different semantics. */
static bool
legal_cast_p (gimple *gs, tree rhs)
{
if (!is_gimple_assign (gs)
|| !CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (gs)))
return false;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
return legal_cast_p_1 (TREE_TYPE (gimple_assign_lhs (gs)), TREE_TYPE (rhs));
}
/* Given GS which is a cast to a scalar integer type, determine whether
the cast is legal for strength reduction. If so, make at least one
appropriate entry in the candidate table. */
static void
slsr_process_cast (gimple *gs, tree rhs1, bool speed)
{
tree lhs, ctype;
slsr_cand_t base_cand, c = NULL, c2;
unsigned savings = 0;
if (!legal_cast_p (gs, rhs1))
return;
lhs = gimple_assign_lhs (gs);
base_cand = base_cand_from_table (rhs1);
ctype = TREE_TYPE (lhs);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (base_cand && base_cand->kind != CAND_PHI)
{
while (base_cand)
{
/* Propagate all data from the base candidate except the type,
which comes from the cast, and the base candidate's cast,
which is no longer applicable. */
if (has_single_use (rhs1))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
c = alloc_cand_and_find_basis (base_cand->kind, gs,
base_cand->base_expr,
base_cand->index, base_cand->stride,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
ctype, base_cand->stride_type,
savings);
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
}
else
{
/* If nothing is known about the RHS, create fresh CAND_ADD and
CAND_MULT interpretations:
X = Y + (0 * 1)
X = (Y + 0) * 1
The first of these is somewhat arbitrary, but the choice of
1 for the stride simplifies the logic for propagating casts
into their uses. */
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
c = alloc_cand_and_find_basis (CAND_ADD, gs, rhs1, 0,
integer_one_node, ctype, sizetype, 0);
c2 = alloc_cand_and_find_basis (CAND_MULT, gs, rhs1, 0,
integer_one_node, ctype, sizetype, 0);
c->next_interp = c2->cand_num;
}
/* Add the first (or only) interpretation to the statement-candidate
mapping. */
add_cand_for_stmt (gs, c);
}
/* Given GS which is a copy of a scalar integer type, make at least one
appropriate entry in the candidate table.
This interface is included for completeness, but is unnecessary
if this pass immediately follows a pass that performs copy
propagation, such as DOM. */
static void
slsr_process_copy (gimple *gs, tree rhs1, bool speed)
{
slsr_cand_t base_cand, c = NULL, c2;
unsigned savings = 0;
base_cand = base_cand_from_table (rhs1);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (base_cand && base_cand->kind != CAND_PHI)
{
while (base_cand)
{
/* Propagate all data from the base candidate. */
if (has_single_use (rhs1))
savings = (base_cand->dead_savings
+ stmt_cost (base_cand->cand_stmt, speed));
c = alloc_cand_and_find_basis (base_cand->kind, gs,
base_cand->base_expr,
base_cand->index, base_cand->stride,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
base_cand->cand_type,
base_cand->stride_type, savings);
if (base_cand->next_interp)
base_cand = lookup_cand (base_cand->next_interp);
else
base_cand = NULL;
}
}
else
{
/* If nothing is known about the RHS, create fresh CAND_ADD and
CAND_MULT interpretations:
X = Y + (0 * 1)
X = (Y + 0) * 1
The first of these is somewhat arbitrary, but the choice of
1 for the stride simplifies the logic for propagating casts
into their uses. */
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
c = alloc_cand_and_find_basis (CAND_ADD, gs, rhs1, 0,
integer_one_node, TREE_TYPE (rhs1),
sizetype, 0);
c2 = alloc_cand_and_find_basis (CAND_MULT, gs, rhs1, 0,
integer_one_node, TREE_TYPE (rhs1),
sizetype, 0);
c->next_interp = c2->cand_num;
}
/* Add the first (or only) interpretation to the statement-candidate
mapping. */
add_cand_for_stmt (gs, c);
}
compare-elim.c (find_comparison_dom_walker): New class * compare-elim.c (find_comparison_dom_walker): New class (find_comparisons_in_bb): Rename to find_comparison_dom_walker::before_dom_children (find_comparisons): Adjust * domwalk.c (walk_dominator_tree): Rename to dom_walker::walk, and adjust. (init_walk_dominator_tree, fini_walk_dominator_tree): Remove * domwalk.h (dom_walk_data): Convert it To a class dom_walker. (init_walk_dominator_tree): Remove declaration. (fini_walk_dominator_tree): Remove declaration. * fwprop.c (single_def_use_dom_walker): New class (single_def_use_enter_block): Convert to single_def_use_dom_walker::before_dom_children. (single_def_use_leave_block): Convert to single_def_use_dom_walker::after_dom_children. (build_single_def_use_links): Adjust. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker): New class. (find_candidates_in_block): Convert to find_candidates_dom_walker::before_dom_children. (execute_strength_reduction): Adjust. * graphite-sese-to-poly.c (struct bsc, build_sese_conditions): Remove. (sese_dom_walker): New class. (sese_dom_walker::sese_dom_walker): New constructor. (sese_dom_walker::~sese_dom_walker): New destructor. (build_sese_conditions_before): Convert to sese_dom_walker::before_dom_children. (build_sese_conditions_after): Convert to sese_dom_walker::after_dom_children. (build_poly_scop): Adjust * tree-into-ssa.c (rewrite_dom_walker): New class (rewrite_enter_block): Convert to rewrite_dom_walker::before_dom_children. (rewrite_leave_block): Convert to rewrite_dom_walker::after_dom_children. (rewrite_update_dom_walker): New class. (rewrite_update_enter_block): Convert to rewrite_update_dom_walker::before_dom_children. (rewrite_update_leave_block): Convert to rewrite_update_dom_walker::after_dom_children. (rewrite_blocks, rewrite_into_ssa): Adjust. (mark_def_dom_walker): New class. (mark_def_dom_walker::mark_def_dom_walker): New constructor. (mark_def_dom_walker::~mark_def_dom_walker): New destructor. (mark_def_sites_blocks): Convert to mark_def_dom_walker::before_dom_children. (mark_def_site_blocks): Remove. * tree-ssa-dom.c (dom_opt_dom_walker): New class. (tree_ssa_dominator_optimize): Adjust. (dom_thread_across_edge): Convert to method dom_opt_dom_walker::thread_across_edge. (dom_opt_enter_block): Convert to member function dom_opt_dom_walker::before_dom_children. (dom_opt_leave_block): Convert to member function dom_opt_dom_walker::after_dom_children. * tree-ssa-dse.c (dse_dom_walker): New class. (dse_enter_block): Convert to member function dse_dom_walker::before_dom_children. (tree_ssa_dse): Adjust. * tree-ssa-loop-im.c (invariantness_dom_walker): New class. (determine_invariantness_stmt): Convert to method invariantness_dom_walker::before_dom_children. (determine_invariantness): Remove (move_computations_dom_walker): New class. (move_computations_stmt): Convert to method move_computations_dom_walker::before_dom_children. (move_computations, tree_ssa_lim): Adjust. * tree-ssa-phiopt.c (nontrapping_dom_walker): new class (nt_init_block): Make method notrappping_dom_walker::before_dom_children. (nt_fini_block): Make method nontrapping_dom_walker::after_dom_children. (get_non_trapping): Adjust. * tree-ssa-pre.c (eliminate_dom_walker): New class. (eliminate_bb): Make method eliminate_dom_walker::before_dom_children. (eliminate_leave_block): Make method. eliminate_dom_walker::after_dom_children. (eliminate): Adjust * tree-ssa-strlen.c (strlen_dom_walker): New class. (strlen_enter_block): Make method strlen_dom_walker::before_dom_children. (strlen_leave_block): Make method strlen_dom_walker::after_dom_children. (tree_ssa_strlen): Adjust. * tree-ssa-uncprop.c (uncprop_dom_walker): New class. (tree_ssa_uncprop): Adjust. (uncprop_leave_block): Make method uncprop_dom_walker::after_dom_children. (uncprop_leave_block): Make method uncprop_dom_walker::before_dom_children. From-SVN: r202679
2013-09-18 04:39:50 +02:00
class find_candidates_dom_walker : public dom_walker
{
public:
find_candidates_dom_walker (cdi_direction direction)
: dom_walker (direction) {}
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);
compare-elim.c (find_comparison_dom_walker): New class * compare-elim.c (find_comparison_dom_walker): New class (find_comparisons_in_bb): Rename to find_comparison_dom_walker::before_dom_children (find_comparisons): Adjust * domwalk.c (walk_dominator_tree): Rename to dom_walker::walk, and adjust. (init_walk_dominator_tree, fini_walk_dominator_tree): Remove * domwalk.h (dom_walk_data): Convert it To a class dom_walker. (init_walk_dominator_tree): Remove declaration. (fini_walk_dominator_tree): Remove declaration. * fwprop.c (single_def_use_dom_walker): New class (single_def_use_enter_block): Convert to single_def_use_dom_walker::before_dom_children. (single_def_use_leave_block): Convert to single_def_use_dom_walker::after_dom_children. (build_single_def_use_links): Adjust. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker): New class. (find_candidates_in_block): Convert to find_candidates_dom_walker::before_dom_children. (execute_strength_reduction): Adjust. * graphite-sese-to-poly.c (struct bsc, build_sese_conditions): Remove. (sese_dom_walker): New class. (sese_dom_walker::sese_dom_walker): New constructor. (sese_dom_walker::~sese_dom_walker): New destructor. (build_sese_conditions_before): Convert to sese_dom_walker::before_dom_children. (build_sese_conditions_after): Convert to sese_dom_walker::after_dom_children. (build_poly_scop): Adjust * tree-into-ssa.c (rewrite_dom_walker): New class (rewrite_enter_block): Convert to rewrite_dom_walker::before_dom_children. (rewrite_leave_block): Convert to rewrite_dom_walker::after_dom_children. (rewrite_update_dom_walker): New class. (rewrite_update_enter_block): Convert to rewrite_update_dom_walker::before_dom_children. (rewrite_update_leave_block): Convert to rewrite_update_dom_walker::after_dom_children. (rewrite_blocks, rewrite_into_ssa): Adjust. (mark_def_dom_walker): New class. (mark_def_dom_walker::mark_def_dom_walker): New constructor. (mark_def_dom_walker::~mark_def_dom_walker): New destructor. (mark_def_sites_blocks): Convert to mark_def_dom_walker::before_dom_children. (mark_def_site_blocks): Remove. * tree-ssa-dom.c (dom_opt_dom_walker): New class. (tree_ssa_dominator_optimize): Adjust. (dom_thread_across_edge): Convert to method dom_opt_dom_walker::thread_across_edge. (dom_opt_enter_block): Convert to member function dom_opt_dom_walker::before_dom_children. (dom_opt_leave_block): Convert to member function dom_opt_dom_walker::after_dom_children. * tree-ssa-dse.c (dse_dom_walker): New class. (dse_enter_block): Convert to member function dse_dom_walker::before_dom_children. (tree_ssa_dse): Adjust. * tree-ssa-loop-im.c (invariantness_dom_walker): New class. (determine_invariantness_stmt): Convert to method invariantness_dom_walker::before_dom_children. (determine_invariantness): Remove (move_computations_dom_walker): New class. (move_computations_stmt): Convert to method move_computations_dom_walker::before_dom_children. (move_computations, tree_ssa_lim): Adjust. * tree-ssa-phiopt.c (nontrapping_dom_walker): new class (nt_init_block): Make method notrappping_dom_walker::before_dom_children. (nt_fini_block): Make method nontrapping_dom_walker::after_dom_children. (get_non_trapping): Adjust. * tree-ssa-pre.c (eliminate_dom_walker): New class. (eliminate_bb): Make method eliminate_dom_walker::before_dom_children. (eliminate_leave_block): Make method. eliminate_dom_walker::after_dom_children. (eliminate): Adjust * tree-ssa-strlen.c (strlen_dom_walker): New class. (strlen_enter_block): Make method strlen_dom_walker::before_dom_children. (strlen_leave_block): Make method strlen_dom_walker::after_dom_children. (tree_ssa_strlen): Adjust. * tree-ssa-uncprop.c (uncprop_dom_walker): New class. (tree_ssa_uncprop): Adjust. (uncprop_leave_block): Make method uncprop_dom_walker::after_dom_children. (uncprop_leave_block): Make method uncprop_dom_walker::before_dom_children. From-SVN: r202679
2013-09-18 04:39:50 +02:00
};
/* Find strength-reduction candidates in block 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
edge
compare-elim.c (find_comparison_dom_walker): New class * compare-elim.c (find_comparison_dom_walker): New class (find_comparisons_in_bb): Rename to find_comparison_dom_walker::before_dom_children (find_comparisons): Adjust * domwalk.c (walk_dominator_tree): Rename to dom_walker::walk, and adjust. (init_walk_dominator_tree, fini_walk_dominator_tree): Remove * domwalk.h (dom_walk_data): Convert it To a class dom_walker. (init_walk_dominator_tree): Remove declaration. (fini_walk_dominator_tree): Remove declaration. * fwprop.c (single_def_use_dom_walker): New class (single_def_use_enter_block): Convert to single_def_use_dom_walker::before_dom_children. (single_def_use_leave_block): Convert to single_def_use_dom_walker::after_dom_children. (build_single_def_use_links): Adjust. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker): New class. (find_candidates_in_block): Convert to find_candidates_dom_walker::before_dom_children. (execute_strength_reduction): Adjust. * graphite-sese-to-poly.c (struct bsc, build_sese_conditions): Remove. (sese_dom_walker): New class. (sese_dom_walker::sese_dom_walker): New constructor. (sese_dom_walker::~sese_dom_walker): New destructor. (build_sese_conditions_before): Convert to sese_dom_walker::before_dom_children. (build_sese_conditions_after): Convert to sese_dom_walker::after_dom_children. (build_poly_scop): Adjust * tree-into-ssa.c (rewrite_dom_walker): New class (rewrite_enter_block): Convert to rewrite_dom_walker::before_dom_children. (rewrite_leave_block): Convert to rewrite_dom_walker::after_dom_children. (rewrite_update_dom_walker): New class. (rewrite_update_enter_block): Convert to rewrite_update_dom_walker::before_dom_children. (rewrite_update_leave_block): Convert to rewrite_update_dom_walker::after_dom_children. (rewrite_blocks, rewrite_into_ssa): Adjust. (mark_def_dom_walker): New class. (mark_def_dom_walker::mark_def_dom_walker): New constructor. (mark_def_dom_walker::~mark_def_dom_walker): New destructor. (mark_def_sites_blocks): Convert to mark_def_dom_walker::before_dom_children. (mark_def_site_blocks): Remove. * tree-ssa-dom.c (dom_opt_dom_walker): New class. (tree_ssa_dominator_optimize): Adjust. (dom_thread_across_edge): Convert to method dom_opt_dom_walker::thread_across_edge. (dom_opt_enter_block): Convert to member function dom_opt_dom_walker::before_dom_children. (dom_opt_leave_block): Convert to member function dom_opt_dom_walker::after_dom_children. * tree-ssa-dse.c (dse_dom_walker): New class. (dse_enter_block): Convert to member function dse_dom_walker::before_dom_children. (tree_ssa_dse): Adjust. * tree-ssa-loop-im.c (invariantness_dom_walker): New class. (determine_invariantness_stmt): Convert to method invariantness_dom_walker::before_dom_children. (determine_invariantness): Remove (move_computations_dom_walker): New class. (move_computations_stmt): Convert to method move_computations_dom_walker::before_dom_children. (move_computations, tree_ssa_lim): Adjust. * tree-ssa-phiopt.c (nontrapping_dom_walker): new class (nt_init_block): Make method notrappping_dom_walker::before_dom_children. (nt_fini_block): Make method nontrapping_dom_walker::after_dom_children. (get_non_trapping): Adjust. * tree-ssa-pre.c (eliminate_dom_walker): New class. (eliminate_bb): Make method eliminate_dom_walker::before_dom_children. (eliminate_leave_block): Make method. eliminate_dom_walker::after_dom_children. (eliminate): Adjust * tree-ssa-strlen.c (strlen_dom_walker): New class. (strlen_enter_block): Make method strlen_dom_walker::before_dom_children. (strlen_leave_block): Make method strlen_dom_walker::after_dom_children. (tree_ssa_strlen): Adjust. * tree-ssa-uncprop.c (uncprop_dom_walker): New class. (tree_ssa_uncprop): Adjust. (uncprop_leave_block): Make method uncprop_dom_walker::after_dom_children. (uncprop_leave_block): Make method uncprop_dom_walker::before_dom_children. From-SVN: r202679
2013-09-18 04:39:50 +02:00
find_candidates_dom_walker::before_dom_children (basic_block bb)
{
bool speed = optimize_bb_for_speed_p (bb);
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
for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
gsi_next (&gsi))
slsr_process_phi (gsi.phi (), speed);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
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
for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
gsi_next (&gsi))
{
gimple *gs = gsi_stmt (gsi);
if (gimple_vuse (gs) && gimple_assign_single_p (gs))
slsr_process_ref (gs);
else if (is_gimple_assign (gs)
&& SCALAR_INT_MODE_P
(TYPE_MODE (TREE_TYPE (gimple_assign_lhs (gs)))))
{
tree rhs1 = NULL_TREE, rhs2 = NULL_TREE;
switch (gimple_assign_rhs_code (gs))
{
case MULT_EXPR:
case PLUS_EXPR:
rhs1 = gimple_assign_rhs1 (gs);
rhs2 = gimple_assign_rhs2 (gs);
/* Should never happen, but currently some buggy situations
in earlier phases put constants in rhs1. */
if (TREE_CODE (rhs1) != SSA_NAME)
continue;
break;
/* Possible future opportunity: rhs1 of a ptr+ can be
an ADDR_EXPR. */
case POINTER_PLUS_EXPR:
case MINUS_EXPR:
rhs2 = gimple_assign_rhs2 (gs);
gcc_fallthrough ();
CASE_CONVERT:
case SSA_NAME:
case NEGATE_EXPR:
rhs1 = gimple_assign_rhs1 (gs);
if (TREE_CODE (rhs1) != SSA_NAME)
continue;
break;
default:
;
}
switch (gimple_assign_rhs_code (gs))
{
case MULT_EXPR:
slsr_process_mul (gs, rhs1, rhs2, speed);
break;
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
case MINUS_EXPR:
slsr_process_add (gs, rhs1, rhs2, speed);
break;
case NEGATE_EXPR:
slsr_process_neg (gs, rhs1, speed);
break;
CASE_CONVERT:
slsr_process_cast (gs, rhs1, speed);
break;
case SSA_NAME:
slsr_process_copy (gs, rhs1, speed);
break;
default:
;
}
}
}
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;
}
/* Dump a candidate for debug. */
static void
dump_candidate (slsr_cand_t c)
{
fprintf (dump_file, "%3d [%d] ", c->cand_num,
gimple_bb (c->cand_stmt)->index);
print_gimple_stmt (dump_file, c->cand_stmt, 0, 0);
switch (c->kind)
{
case CAND_MULT:
fputs (" MULT : (", dump_file);
print_generic_expr (dump_file, c->base_expr, 0);
fputs (" + ", dump_file);
2014-05-06 18:25:05 +02:00
print_decs (c->index, dump_file);
fputs (") * ", dump_file);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
if (TREE_CODE (c->stride) != INTEGER_CST
&& c->stride_type != TREE_TYPE (c->stride))
{
fputs ("(", dump_file);
print_generic_expr (dump_file, c->stride_type, 0);
fputs (")", dump_file);
}
print_generic_expr (dump_file, c->stride, 0);
fputs (" : ", dump_file);
break;
case CAND_ADD:
fputs (" ADD : ", dump_file);
print_generic_expr (dump_file, c->base_expr, 0);
fputs (" + (", dump_file);
2014-05-06 18:25:05 +02:00
print_decs (c->index, dump_file);
fputs (" * ", dump_file);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
if (TREE_CODE (c->stride) != INTEGER_CST
&& c->stride_type != TREE_TYPE (c->stride))
{
fputs ("(", dump_file);
print_generic_expr (dump_file, c->stride_type, 0);
fputs (")", dump_file);
}
print_generic_expr (dump_file, c->stride, 0);
fputs (") : ", dump_file);
break;
case CAND_REF:
fputs (" REF : ", dump_file);
print_generic_expr (dump_file, c->base_expr, 0);
fputs (" + (", dump_file);
print_generic_expr (dump_file, c->stride, 0);
fputs (") + ", dump_file);
2014-05-06 18:25:05 +02:00
print_decs (c->index, dump_file);
fputs (" : ", dump_file);
break;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
case CAND_PHI:
fputs (" PHI : ", dump_file);
print_generic_expr (dump_file, c->base_expr, 0);
fputs (" + (unknown * ", dump_file);
print_generic_expr (dump_file, c->stride, 0);
fputs (") : ", dump_file);
break;
default:
gcc_unreachable ();
}
print_generic_expr (dump_file, c->cand_type, 0);
fprintf (dump_file, "\n basis: %d dependent: %d sibling: %d\n",
c->basis, c->dependent, c->sibling);
fprintf (dump_file, " next-interp: %d dead-savings: %d\n",
c->next_interp, c->dead_savings);
if (c->def_phi)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
fprintf (dump_file, " phi: %d\n", c->def_phi);
fputs ("\n", dump_file);
}
/* Dump the candidate vector for debug. */
static void
dump_cand_vec (void)
{
unsigned i;
slsr_cand_t c;
fprintf (dump_file, "\nStrength reduction candidate vector:\n\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
FOR_EACH_VEC_ELT (cand_vec, i, c)
dump_candidate (c);
}
/* Callback used to dump the candidate chains hash table. */
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
int
ssa_base_cand_dump_callback (cand_chain **slot, void *ignored ATTRIBUTE_UNUSED)
{
This patch is the main part of a consolodation of the hash_table patches to the... This patch is the main part of a consolodation of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-parloops.c'reduction * tree-parloops.c'name_to_copy Fold reduction_info_hash and reduction_info_eq into new struct reduction_hasher. Fold name_to_copy_elt_eq and name_to_copy_elt_hash into new struct name_to_copy_hasher. * trans-mem.c'tm_log Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher. * trans-mem.c'tm_memopt_value_numbers Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher. * tree-ssa-strlen.c'decl_to_stridxlist_htab Fold decl_to_stridxlist_hash into new struct stridxlist_hasher. * tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct iv_inv_expr_hasher. * tree-ssa-uncprop.c'equiv Equiv renamed to val_ssa_equiv because of name ambiguity with local variables. Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher. Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity with struct type. Changed equiv_hash_elt_p to an_equiv_elt_p to match. * tree-ssa-phiopt.c'seen_ssa_names Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher. * tree-ssa-structalias.c'pointer_equiv_class_table * tree-ssa-structalias.c'location_equiv_class_table Fold equiv_class_label_hash and equiv_class_label_eq into new struct equiv_class_hasher. * tree-ssa-structalias.c'shared_bitmap_table Fold shared_bitmap_hash and shared_bitmap_eq into new struct shared_bitmap_hasher. * tree-ssa-live.c'var_map_base_init::tree_to_index New struct tree_int_map_hasher. * tree-sra.c'candidates Fold uid_decl_map_hash and uid_decl_map_eq into new struct uid_decl_hasher. This change moves the definitions from tree-ssa.c into tree-sra.c and removes the declarations from tree-flow.h tree-browser.c Remove stale declaration of removed TB_parent_eq. Fix template parameter for base class to match value_type. gimple.h Use gimplify_hasher::hash rather than gimple_tree_hash in the assertion check. Change return values to match return type. (I.e. no conversions.) * graphite-clast-to-gimple.c'ivs_params::newivs_index * graphite-clast-to-gimple.c'ivs_params::params_index * graphite-clast-to-gimple.c'print_generated_program::params_index * graphite-clast-to-gimple.c'gloog::newivs_index * graphite-clast-to-gimple.c'gloog::params_index * graphite.c graphite_transform_loops::bb_pbb_mapping * sese.c copy_bb_and_scalar_dependences::rename_map Move hash table declarations to a new graphite-htab.h, because they are used in few places. Remove unused: htab_t scop::original_pddrs SCOP_ORIGINAL_PDDRS Remove unused: insert_loop_close_phis insert_guard_phis debug_ivtype_map ivtype_map_elt_info new_ivtype_map_elt * gimplify.c'gimplify_ctx::temp_htab Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new gimplify-ctx.h, because they are used few places. * cselib.c'cselib_hash_table * gcse.c'pre_ldst_table * gimple-ssa-strength-reduction.c'base_cand_map * haifa-sched.c'delay_htab * haifa-sched.c'delay_htab_i2 * ira-color.c'allocno_hard_regs_htab * ira-costs.c'cost_classes_htab * loop-invariant.c'merge_identical_invariants::eq * loop-iv.c'bivs * loop-unroll.c'opt_info::insns_to_split * loop-unroll.c'opt_info::insns_with_var_to_expand * passes.c'name_to_pass_map * plugin.c'event_tab * postreload-gcse.c'expr_table * store-motion.c'store_motion_mems_table * tree-cfg.c'discriminator_per_locus * tree-scalar-evolution.c'resolve_mixers::cache * tree-ssa-dom.c'avail_exprs Remove unused: dse.c bitmap clear_alias_sets dse.c bitmap disqualified_clear_alias_sets dse.c alloc_pool clear_alias_mode_pool dse.c dse_step2_spill dse.c dse_step5_spill graphds.h htab_t graph::indices * attribs.c'scoped_attributes::attribute_hash * bitmap.c'bitmap_desc_hash * dwarf2cfi.c'trace_index * dwarf2out.c'break_out_includes::cu_hash_table * dwarf2out.c'copy_decls_for_unworthy_types::decl_table * dwarf2out.c'optimize_external_refs::map * dwarf2out.c'output_comp_unit::extern_map * dwarf2out.c'output_comdat_type_unit::extern_map * dwarf2out.c'output_macinfo::macinfo_htab * dwarf2out.c'optimize_location_lists::htab * dwarf2out.c'dwarf2out_finish::comdat_type_table * except.c'ehspec_hash_type * except.c'assign_filter_values::ttypes * except.c'assign_filter_values::ehspec * except.c'sjlj_assign_call_site_values::ar_hash * except.c'convert_to_eh_region_ranges::ar_hash * trans-mem.c'tm_new_mem_hash * tree-browser.c'TB_up_ht * tree-eh.c'finally_tree Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash in alloc-pool.c to after the method definitions for its parameter class. * ggc-common.c'loc_hash * ggc-common.c'ptr_hash Add a new hash_table method elements_with_deleted to meet the needs of gcc-common.c. Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change, but incorrect code will.) * tree-complex.c'complex_variable_components * tree-parloops.c'eliminate_local_variables_stmt::decl_address * tree-parloops.c'separate_decls_in_region::decl_copies Move hash table declarations to a new tree-hasher.h, to resolve compilation dependences and because they are used in few places. * lto-streamer.h'output_block::string_hash_table * lto-streamer-in.c'file_name_hash_table * lto-streamer.c'tree_htab The struct string_slot moves from data-streamer.h to lto-streamer.h to resolve compilation dependences. Tested on x86_64. Index: gcc/ChangeLog 2013-04-25 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash): Move declaration to after the type's method definitons. * attribs.c (htab_t scoped_attributes::attribute_hash): Change type to hash_table. Update dependent calls and types. * bitmap.c (htab_t bitmap_desc_hash): Change type to hash_table. Update dependent calls and types. * cselib.c (htab_t cselib_hash_table): Change type to hash_table. Update dependent calls and types. * data-streamer.h (struct string_slot): Move to lto-streamer.h. (hash_string_slot_node): Move implementation into lto-streamer.h struct string_slot_hasher. (eq_string_slot_node): Likewise. * data-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * dwarf2cfi.c (htab_t trace_index): Change type to hash_table. Update dependent calls and types. * dwarf2out.c (htab_t break_out_includes::cu_hash_table): Change type to hash_table. Update dependent calls and types. (htab_t copy_decls_for_unworthy_types::decl_table): Likewise. (htab_t optimize_external_refs::map): Likewise. (htab_t output_comp_unit::extern_map): Likewise. (htab_t output_comdat_type_unit::extern_map): Likewise. (htab_t output_macinfo::macinfo_htab): Likewise. (htab_t optimize_location_lists::htab): Likewise. (htab_t dwarf2out_finish::comdat_type_table): Likewise. * except.c (htab_t ehspec_hash_type): Change type to hash_table. Update dependent calls and types. (assign_filter_values::ttypes): Likewise. (assign_filter_values::ehspec): Likewise. (sjlj_assign_call_site_values::ar_hash): Likewise. (convert_to_eh_region_ranges::ar_hash): Likewise. * gcse.c (htab_t pre_ldst_table): Change type to hash_table. Update dependent calls and types. * ggc-common.c (htab_t saving_htab): Change type to hash_table. Update dependent calls and types. (htab_t loc_hash): Likewise. (htab_t ptr_hash): Likewise. (call_count): Rename ggc_call_count. (call_alloc): Rename ggc_call_alloc. (loc_descriptor): Rename make_loc_descriptor. (add_statistics): Rename ggc_add_statistics. * ggc-common.c (saving_htab): Change type to hash_table. Update dependent calls and types. * gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h. (push_gimplify_context): Likewise. (pop_gimplify_context): Likewise. (struct gimple_temp_hash_elt): Added. (struct gimplify_hasher): Likewise. (struct gimplify_ctx.temp_htab): Change type to hash_table. Update dependent calls and types. * gimple-fold.c: Include gimplify-ctx.h. * gimple-ssa-strength-reduction.c (htab_t base_cand_map): Change type to hash_table. Update dependent calls and types. (base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to avoid potential global name collision. * gimplify.c: Include gimplify-ctx.h. (struct gimple_temp_hash_elt): Move to gimplify-ctx.h. (htab_t gimplify_ctx::temp_htab): Update dependent calls and types for new type hash_table. (gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h. (gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h. * gimplify-ctx.h: New. (struct gimple_temp_hash_elt): Move from gimplify.c. (class gimplify_hasher): New. (struct gimplify_ctx): Move from gimple.h. (htab_t gimplify_ctx::temp_htab): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.c: Include graphite-htab.h. (htab_t ivs_params::newivs_index): Change type to hash_table. Update dependent calls and types. (htab_t ivs_params::params_index): Likewise. (htab_t print_generated_program::params_index): Likewise. (htab_t gloog::newivs_index): Likewise. (htab_t gloog::params_index): Likewise. * graphite.c: Include graphite-htab.h. 4htab_t graphite_transform_loops::bb_pbb_mapping): Change type to hash_table. Update dependent calls and types. * graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h. (bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h. (eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h. * graphite-dependences.c: Include graphite-htab.h. (loop_is_parallel_p): Change hash table type of parameter. * graphite-htab.h: New. (typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New. (extern find_pbb_via_hash): Move from graphite-poly.h. (extern loop_is_parallel_p): Move from graphite-poly.h. (extern get_loop_body_pbbs): Move from graphite-poly.h. * graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h. (extern loop_is_parallel_p): Move to graphite-htab.h. (extern get_loop_body_pbbs): Move to graphite-htab.h. * haifa-sched.c (htab_t delay_htab): Change type to hash_table. Update dependent calls and types. (htab_t delay_htab_i2): Likewise. * ira-color.c (htab_t allocno_hard_regs_htab): Change type to hash_table. Update dependent calls and types. * ira-costs.c (htab_t cost_classes_htab): Change type to hash_table. Update dependent calls and types. * loop-invariant.c (htab_t merge_identical_invariants::eq): Change type to hash_table. Update dependent calls and types. * loop-iv.c (htab_t bivs): Change type to hash_table. Update dependent calls and types. * loop-unroll.c (htab_t opt_info::insns_to_split): Change type to hash_table. Update dependent calls and types. (htab_t opt_info::insns_with_var_to_expand): Likewise. * lto-streamer.h (struct string_slot): Move from data-streamer.h (struct string_slot_hasher): New. (htab_t output_block::string_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-in.c (freeing_string_slot_hasher): New. (htab_t file_name_hash_table): Change type to hash_table. Update dependent calls and types. * lto-streamer-out.c: Update output_block::string_hash_table dependent calls and types. * lto-streamer.c (htab_t tree_htab): Change type to hash_table. Update dependent calls and types. * omp-low.c: Include gimplify-ctx.h. * passes.c (htab_t name_to_pass_map): Change type to hash_table. Update dependent calls and types. (pass_traverse): Rename to passes_pass_traverse. * plugin.c (htab_t event_tab): Change type to hash_table. Update dependent calls and types. * postreload-gcse.c (htab_t expr_table): Change type to hash_table. Update dependent calls and types. (dump_hash_table_entry): Rename dump_expr_hash_table_entry. * sese.c (debug_rename_map_1): Make extern. (htab_t copy_bb_and_scalar_dependences::rename_map): Change type to hash_table. Update dependent calls and types. * sese.h (extern debug_rename_map): Move to .c file. * store-motion.c (htab_t store_motion_mems_table): Change type to hash_table. Update dependent calls and types. * trans-mem.c (htab_t tm_new_mem_hash): Change type to hash_table. Update dependent calls and types. * tree-browser.c (htab_t TB_up_ht): Change type to hash_table. Update dependent calls and types. * tree-cfg.c (htab_t discriminator_per_locus): Change type to hash_table. Update dependent calls and types. * tree-complex.c: Include tree-hasher.h (htab_t complex_variable_components): Change type to hash_table. Update dependent calls and types. * tree-eh.c (htab_t finally_tree): Change type to hash_table. Update dependent calls and types. * tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher struct int_tree_hasher. (extern int_tree_map_eq): Likewise. (uid_decl_map_hash): Removed. (extern decl_tree_map_eq): Likewise. * tree-hasher.h: New. (struct int_tree_hasher): New. (typedef int_tree_htab_type): New. * tree-inline.c: Include gimplify-ctx.h. * tree-mudflap.c: Include gimplify-ctx.h. * tree-parloops.c: Include tree-hasher.h. (htab_t eliminate_local_variables_stmt::decl_address): Change type to hash_table. Update dependent calls and types. (htab_t separate_decls_in_region::decl_copies): Likewise. * tree-scalar-evolution.c (htab_t resolve_mixers::cache): Change type to hash_table. Update dependent calls and types. * tree-sra.c (candidates): Change type to hash_table. Update dependent calls and types. * tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher in tree-flow.h. (int_tree_map_hash): Likewise. * tree-ssa-dom.c (htab_t avail_exprs): Change type to hash_table. Update dependent calls and types. * tree-ssa-live.c (var_map_base_init::tree_to_index): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab): Change type to hash_table. Update dependent calls and types. * tree-ssa-phiopt.c (seen_ssa_names): Change type to hash_table. Update dependent calls and types. * tree-ssa-strlen.c (decl_to_stridxlist_htab): Change type to hash_table. Update dependent calls and types. * tree-ssa-uncprop.c (equiv): Change type to hash_table. Update dependent calls and types. From-SVN: r198329
2013-04-26 02:28:35 +02:00
const_cand_chain_t chain = *slot;
cand_chain_t p;
print_generic_expr (dump_file, chain->base_expr, 0);
fprintf (dump_file, " -> %d", chain->cand->cand_num);
for (p = chain->next; p; p = p->next)
fprintf (dump_file, " -> %d", p->cand->cand_num);
fputs ("\n", dump_file);
return 1;
}
/* Dump the candidate chains. */
static void
dump_cand_chains (void)
{
fprintf (dump_file, "\nStrength reduction candidate chains:\n\n");
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
base_cand_map->traverse_noresize <void *, ssa_base_cand_dump_callback>
(NULL);
fputs ("\n", dump_file);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Dump the increment vector for debug. */
static void
dump_incr_vec (void)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
unsigned i;
fprintf (dump_file, "\nIncrement vector:\n\n");
for (i = 0; i < incr_vec_len; i++)
{
fprintf (dump_file, "%3d increment: ", i);
2014-05-06 18:25:05 +02:00
print_decs (incr_vec[i].incr, dump_file);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
fprintf (dump_file, "\n count: %d", incr_vec[i].count);
fprintf (dump_file, "\n cost: %d", incr_vec[i].cost);
fputs ("\n initializer: ", dump_file);
print_generic_expr (dump_file, incr_vec[i].initializer, 0);
fputs ("\n\n", dump_file);
}
}
}
/* Replace *EXPR in candidate C with an equivalent strength-reduced
data reference. */
static void
replace_ref (tree *expr, slsr_cand_t c)
{
tree add_expr, mem_ref, acc_type = TREE_TYPE (*expr);
unsigned HOST_WIDE_INT misalign;
unsigned align;
/* Ensure the memory reference carries the minimum alignment
requirement for the data type. See PR58041. */
get_object_alignment_1 (*expr, &align, &misalign);
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 (acc_type))
acc_type = build_aligned_type (acc_type, align);
add_expr = fold_build2 (POINTER_PLUS_EXPR, c->cand_type,
c->base_expr, c->stride);
mem_ref = fold_build2 (MEM_REF, acc_type, add_expr,
2014-05-06 18:25:05 +02:00
wide_int_to_tree (c->cand_type, c->index));
/* Gimplify the base addressing expression for the new MEM_REF tree. */
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
TREE_OPERAND (mem_ref, 0)
= force_gimple_operand_gsi (&gsi, TREE_OPERAND (mem_ref, 0),
/*simple_p=*/true, NULL,
/*before=*/true, GSI_SAME_STMT);
copy_ref_info (mem_ref, *expr);
*expr = mem_ref;
update_stmt (c->cand_stmt);
}
/* Replace CAND_REF candidate C, each sibling of candidate C, and each
dependent of candidate C with an equivalent strength-reduced data
reference. */
static void
replace_refs (slsr_cand_t c)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("Replacing reference: ", dump_file);
print_gimple_stmt (dump_file, c->cand_stmt, 0, 0);
}
if (gimple_vdef (c->cand_stmt))
{
tree *lhs = gimple_assign_lhs_ptr (c->cand_stmt);
replace_ref (lhs, c);
}
else
{
tree *rhs = gimple_assign_rhs1_ptr (c->cand_stmt);
replace_ref (rhs, c);
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("With: ", dump_file);
print_gimple_stmt (dump_file, c->cand_stmt, 0, 0);
fputs ("\n", dump_file);
}
if (c->sibling)
replace_refs (lookup_cand (c->sibling));
if (c->dependent)
replace_refs (lookup_cand (c->dependent));
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Return TRUE if candidate C is dependent upon a PHI. */
static bool
phi_dependent_cand_p (slsr_cand_t c)
{
/* A candidate is not necessarily dependent upon a PHI just because
it has a phi definition for its base name. It may have a basis
that relies upon the same phi definition, in which case the PHI
is irrelevant to this candidate. */
return (c->def_phi
&& c->basis
&& lookup_cand (c->basis)->def_phi != c->def_phi);
}
/* Calculate the increment required for candidate C relative to
its basis. */
2014-05-06 18:25:05 +02:00
static widest_int
cand_increment (slsr_cand_t c)
{
slsr_cand_t basis;
/* If the candidate doesn't have a basis, just return its own
index. This is useful in record_increments to help us find
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
an existing initializer. Also, if the candidate's basis is
hidden by a phi, then its own index will be the increment
from the newly introduced phi basis. */
if (!c->basis || phi_dependent_cand_p (c))
return c->index;
basis = lookup_cand (c->basis);
gcc_assert (operand_equal_p (c->base_expr, basis->base_expr, 0));
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
return c->index - basis->index;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Calculate the increment required for candidate C relative to
its basis. If we aren't going to generate pointer arithmetic
for this candidate, return the absolute value of that increment
instead. */
2014-05-06 18:25:05 +02:00
static inline widest_int
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
cand_abs_increment (slsr_cand_t c)
{
2014-05-06 18:25:05 +02:00
widest_int increment = cand_increment (c);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
2014-05-06 18:25:05 +02:00
if (!address_arithmetic_p && wi::neg_p (increment))
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
increment = -increment;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
return increment;
}
/* Return TRUE iff candidate C has already been replaced under
another interpretation. */
static inline bool
cand_already_replaced (slsr_cand_t c)
{
return (gimple_bb (c->cand_stmt) == 0);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Common logic used by replace_unconditional_candidate and
replace_conditional_candidate. */
static void
2014-05-06 18:25:05 +02:00
replace_mult_candidate (slsr_cand_t c, tree basis_name, widest_int bump)
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
tree target_type = TREE_TYPE (gimple_assign_lhs (c->cand_stmt));
enum tree_code cand_code = gimple_assign_rhs_code (c->cand_stmt);
/* It is not useful to replace casts, copies, negates, or adds of
an SSA name and a constant. */
if (cand_code == SSA_NAME
|| CONVERT_EXPR_CODE_P (cand_code)
|| cand_code == PLUS_EXPR
|| cand_code == POINTER_PLUS_EXPR
|| cand_code == MINUS_EXPR
|| cand_code == NEGATE_EXPR)
return;
enum tree_code code = PLUS_EXPR;
tree bump_tree;
gimple *stmt_to_print = NULL;
/* If the basis name and the candidate's LHS have incompatible
types, introduce a cast. */
if (!useless_type_conversion_p (target_type, TREE_TYPE (basis_name)))
basis_name = introduce_cast_before_cand (c, target_type, basis_name);
if (wi::neg_p (bump))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
code = MINUS_EXPR;
bump = -bump;
}
/* It is possible that the resulting bump doesn't fit in target_type.
Abandon the replacement in this case. This does not affect
siblings or dependents of C. */
if (bump != wi::ext (bump, TYPE_PRECISION (target_type),
TYPE_SIGN (target_type)))
return;
bump_tree = wide_int_to_tree (target_type, bump);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("Replacing: ", dump_file);
print_gimple_stmt (dump_file, c->cand_stmt, 0, 0);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (bump == 0)
{
tree lhs = gimple_assign_lhs (c->cand_stmt);
gassign *copy_stmt = gimple_build_assign (lhs, basis_name);
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
slsr_cand_t cc = c;
gimple_set_location (copy_stmt, gimple_location (c->cand_stmt));
gsi_replace (&gsi, copy_stmt, false);
c->cand_stmt = copy_stmt;
while (cc->next_interp)
{
cc = lookup_cand (cc->next_interp);
cc->cand_stmt = copy_stmt;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
stmt_to_print = copy_stmt;
}
else
{
tree rhs1, rhs2;
if (cand_code != NEGATE_EXPR) {
rhs1 = gimple_assign_rhs1 (c->cand_stmt);
rhs2 = gimple_assign_rhs2 (c->cand_stmt);
}
if (cand_code != NEGATE_EXPR
&& ((operand_equal_p (rhs1, basis_name, 0)
&& operand_equal_p (rhs2, bump_tree, 0))
|| (operand_equal_p (rhs1, bump_tree, 0)
&& operand_equal_p (rhs2, basis_name, 0))))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("(duplicate, not actually replacing)", dump_file);
stmt_to_print = c->cand_stmt;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
else
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
slsr_cand_t cc = c;
gimple_assign_set_rhs_with_ops (&gsi, code,
basis_name, bump_tree);
update_stmt (gsi_stmt (gsi));
c->cand_stmt = gsi_stmt (gsi);
while (cc->next_interp)
{
cc = lookup_cand (cc->next_interp);
cc->cand_stmt = gsi_stmt (gsi);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
stmt_to_print = gsi_stmt (gsi);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("With: ", dump_file);
print_gimple_stmt (dump_file, stmt_to_print, 0, 0);
fputs ("\n", dump_file);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
}
/* Replace candidate C with an add or subtract. Note that we only
operate on CAND_MULTs with known strides, so we will never generate
a POINTER_PLUS_EXPR. Each candidate X = (B + i) * S is replaced by
X = Y + ((i - i') * S), as described in the module commentary. The
folded value ((i - i') * S) is referred to here as the "bump." */
static void
replace_unconditional_candidate (slsr_cand_t c)
{
slsr_cand_t basis;
if (cand_already_replaced (c))
return;
basis = lookup_cand (c->basis);
2014-05-06 18:25:05 +02:00
widest_int bump = cand_increment (c) * wi::to_widest (c->stride);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
replace_mult_candidate (c, gimple_assign_lhs (basis->cand_stmt), bump);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
/* Return the index in the increment vector of the given INCREMENT,
or -1 if not found. The latter can occur if more than
MAX_INCR_VEC_LEN increments have been found. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
static inline int
2014-05-06 18:25:05 +02:00
incr_vec_index (const widest_int &increment)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
unsigned i;
for (i = 0; i < incr_vec_len && increment != incr_vec[i].incr; i++)
;
if (i < incr_vec_len)
return i;
else
return -1;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
/* Create a new statement along edge E to add BASIS_NAME to the product
of INCREMENT and the stride of candidate C. Create and return a new
SSA name from *VAR to be used as the LHS of the new statement.
KNOWN_STRIDE is true iff C's stride is a constant. */
static tree
create_add_on_incoming_edge (slsr_cand_t c, tree basis_name,
2014-05-06 18:25:05 +02:00
widest_int increment, edge e, location_t loc,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
bool known_stride)
{
tree lhs, basis_type;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
gassign *new_stmt, *cast_stmt = NULL;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* If the add candidate along this incoming edge has the same
index as C's hidden basis, the hidden basis represents this
edge correctly. */
2014-05-06 18:25:05 +02:00
if (increment == 0)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return basis_name;
basis_type = TREE_TYPE (basis_name);
lhs = make_temp_ssa_name (basis_type, NULL, "slsr");
/* Occasionally people convert integers to pointers without a
cast, leading us into trouble if we aren't careful. */
enum tree_code plus_code
= POINTER_TYPE_P (basis_type) ? POINTER_PLUS_EXPR : PLUS_EXPR;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (known_stride)
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
tree bump_tree;
enum tree_code code = plus_code;
2014-05-06 18:25:05 +02:00
widest_int bump = increment * wi::to_widest (c->stride);
if (wi::neg_p (bump) && !POINTER_TYPE_P (basis_type))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
code = MINUS_EXPR;
bump = -bump;
}
tree stride_type = POINTER_TYPE_P (basis_type) ? sizetype : basis_type;
bump_tree = wide_int_to_tree (stride_type, bump);
gimple.h (gimple_build_assign_stat): Remove prototype. * gimple.h (gimple_build_assign_stat): Remove prototype. (gimple_build_assign): Remove define. Add overload prototypes with tree lhs and either a tree rhs, or enum tree_code and 1, 2 or 3 tree operands. * gimple.c (gimple_build_assign_stat): Renamed to... (gimple_build_assign): ... this. Add overloads with enum tree_code and 1, 2 or 3 tree operands. (gimple_build_assign_with_ops): Remove 1 and 2 operand overloads. Rename the 3 operand overload to ... (gimple_build_assign_1): ... this. Make it static inline. * tree-ssa-strlen.c (get_string_length): Use gimple_build_assign instead of gimple_build_assign_with_ops, swap the order of first two arguments and adjust formatting where necessary. * tree-vect-slp.c (vect_get_constant_vectors, vect_create_mask_and_perm): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_builtin_call): Likewise. * tree-chkp.c (chkp_compute_bounds_for_assignment, chkp_generate_extern_var_bounds): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. * value-prof.c (gimple_divmod_fixed_value, gimple_mod_pow2, gimple_mod_subtract): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern, vect_recog_sad_pattern, vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_recog_pow_pattern, vect_recog_widen_sum_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern, vect_recog_widen_shift_pattern, vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern, vect_recog_divmod_pattern, vect_recog_mixed_size_cond_pattern, adjust_bool_pattern_cast, adjust_bool_pattern, vect_recog_bool_pattern): Likewise. * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge, insert_initializers, introduce_cast_before_cand, replace_one_candidate): Likewise. * tree-ssa-math-opts.c (insert_reciprocals, powi_as_mults_1, powi_as_mults, build_and_insert_binop, build_and_insert_cast, pass_cse_sincos::execute, bswap_replace, convert_mult_to_fma): Likewise. * tree-tailcall.c (adjust_return_value_with_ops, update_accumulator_with_ops): Likewise. * tree-predcom.c (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, attempt_builtin_powi, reassociate_bb): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-ssa-phiopt.c (conditional_replacement, minmax_replacement, abs_replacement, neg_replacement): Likewise. * tree-profile.c (gimple_gen_edge_profiler): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * gimple-fold.c (rewrite_to_defined_overflow, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_bool_enum_load): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. * omp-low.c (lower_rec_input_clauses, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_cilk_for, simd_clone_adjust): Likewise. * trans-mem.c (expand_transaction): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_permute_store_chain, vect_setup_realignment, vect_permute_load_chain, vect_shift_permute_load_chain): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_simd_clone_call, vect_gen_widened_results_half, vect_create_vectorized_demotion_stmts, vectorizable_conversion, vectorizable_shift, vectorizable_operation, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. From-SVN: r218216
2014-12-01 14:58:10 +01:00
new_stmt = gimple_build_assign (lhs, code, basis_name, bump_tree);
}
else
{
int i;
bool negate_incr = !POINTER_TYPE_P (basis_type) && wi::neg_p (increment);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
i = incr_vec_index (negate_incr ? -increment : increment);
gcc_assert (i >= 0);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (incr_vec[i].initializer)
{
enum tree_code code = negate_incr ? MINUS_EXPR : plus_code;
gimple.h (gimple_build_assign_stat): Remove prototype. * gimple.h (gimple_build_assign_stat): Remove prototype. (gimple_build_assign): Remove define. Add overload prototypes with tree lhs and either a tree rhs, or enum tree_code and 1, 2 or 3 tree operands. * gimple.c (gimple_build_assign_stat): Renamed to... (gimple_build_assign): ... this. Add overloads with enum tree_code and 1, 2 or 3 tree operands. (gimple_build_assign_with_ops): Remove 1 and 2 operand overloads. Rename the 3 operand overload to ... (gimple_build_assign_1): ... this. Make it static inline. * tree-ssa-strlen.c (get_string_length): Use gimple_build_assign instead of gimple_build_assign_with_ops, swap the order of first two arguments and adjust formatting where necessary. * tree-vect-slp.c (vect_get_constant_vectors, vect_create_mask_and_perm): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_builtin_call): Likewise. * tree-chkp.c (chkp_compute_bounds_for_assignment, chkp_generate_extern_var_bounds): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. * value-prof.c (gimple_divmod_fixed_value, gimple_mod_pow2, gimple_mod_subtract): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern, vect_recog_sad_pattern, vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_recog_pow_pattern, vect_recog_widen_sum_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern, vect_recog_widen_shift_pattern, vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern, vect_recog_divmod_pattern, vect_recog_mixed_size_cond_pattern, adjust_bool_pattern_cast, adjust_bool_pattern, vect_recog_bool_pattern): Likewise. * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge, insert_initializers, introduce_cast_before_cand, replace_one_candidate): Likewise. * tree-ssa-math-opts.c (insert_reciprocals, powi_as_mults_1, powi_as_mults, build_and_insert_binop, build_and_insert_cast, pass_cse_sincos::execute, bswap_replace, convert_mult_to_fma): Likewise. * tree-tailcall.c (adjust_return_value_with_ops, update_accumulator_with_ops): Likewise. * tree-predcom.c (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, attempt_builtin_powi, reassociate_bb): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-ssa-phiopt.c (conditional_replacement, minmax_replacement, abs_replacement, neg_replacement): Likewise. * tree-profile.c (gimple_gen_edge_profiler): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * gimple-fold.c (rewrite_to_defined_overflow, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_bool_enum_load): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. * omp-low.c (lower_rec_input_clauses, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_cilk_for, simd_clone_adjust): Likewise. * trans-mem.c (expand_transaction): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_permute_store_chain, vect_setup_realignment, vect_permute_load_chain, vect_shift_permute_load_chain): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_simd_clone_call, vect_gen_widened_results_half, vect_create_vectorized_demotion_stmts, vectorizable_conversion, vectorizable_shift, vectorizable_operation, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. From-SVN: r218216
2014-12-01 14:58:10 +01:00
new_stmt = gimple_build_assign (lhs, code, basis_name,
incr_vec[i].initializer);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
else {
tree stride;
if (!types_compatible_p (TREE_TYPE (c->stride), c->stride_type))
{
tree cast_stride = make_temp_ssa_name (c->stride_type, NULL,
"slsr");
cast_stmt = gimple_build_assign (cast_stride, NOP_EXPR,
c->stride);
stride = cast_stride;
}
else
stride = c->stride;
if (increment == 1)
new_stmt = gimple_build_assign (lhs, plus_code, basis_name, stride);
else if (increment == -1)
new_stmt = gimple_build_assign (lhs, MINUS_EXPR, basis_name, stride);
else
gcc_unreachable ();
}
}
if (cast_stmt)
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
{
gimple_set_location (cast_stmt, loc);
gsi_insert_on_edge (e, cast_stmt);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
gimple_set_location (new_stmt, loc);
gsi_insert_on_edge (e, new_stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
if (cast_stmt)
{
fprintf (dump_file, "Inserting cast on edge %d->%d: ",
e->src->index, e->dest->index);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
print_gimple_stmt (dump_file, cast_stmt, 0, 0);
}
fprintf (dump_file, "Inserting on edge %d->%d: ", e->src->index,
e->dest->index);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
print_gimple_stmt (dump_file, new_stmt, 0, 0);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return lhs;
}
/* Given a candidate C with BASIS_NAME being the LHS of C's basis which
is hidden by the phi node FROM_PHI, create a new phi node in the same
block as FROM_PHI. The new phi is suitable for use as a basis by C,
with its phi arguments representing conditional adjustments to the
hidden basis along conditional incoming paths. Those adjustments are
made by creating add statements (and sometimes recursively creating
phis) along those incoming paths. LOC is the location to attach to
the introduced statements. KNOWN_STRIDE is true iff C's stride is a
constant. */
static tree
create_phi_basis (slsr_cand_t c, gimple *from_phi, tree basis_name,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
location_t loc, bool known_stride)
{
int i;
tree name, phi_arg;
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
gphi *phi;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
slsr_cand_t basis = lookup_cand (c->basis);
int nargs = gimple_phi_num_args (from_phi);
basic_block phi_bb = gimple_bb (from_phi);
slsr_cand_t phi_cand = *stmt_cand_map->get (from_phi);
auto_vec<tree> phi_args (nargs);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Process each argument of the existing phi that represents
conditionally-executed add candidates. */
for (i = 0; i < nargs; i++)
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
edge e = (*phi_bb->preds)[i];
tree arg = gimple_phi_arg_def (from_phi, i);
tree feeding_def;
/* If the phi argument is the base name of the CAND_PHI, then
this incoming arc should use the hidden basis. */
if (operand_equal_p (arg, phi_cand->base_expr, 0))
2014-05-06 18:25:05 +02:00
if (basis->index == 0)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
feeding_def = gimple_assign_lhs (basis->cand_stmt);
else
{
2014-05-06 18:25:05 +02:00
widest_int incr = -basis->index;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
feeding_def = create_add_on_incoming_edge (c, basis_name, incr,
e, loc, known_stride);
}
else
{
gimple *arg_def = SSA_NAME_DEF_STMT (arg);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* If there is another phi along this incoming edge, we must
process it in the same fashion to ensure that all basis
adjustments are made along its incoming edges. */
if (gimple_code (arg_def) == GIMPLE_PHI)
feeding_def = create_phi_basis (c, arg_def, basis_name,
loc, known_stride);
else
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
slsr_cand_t arg_cand = base_cand_from_table (arg);
2014-05-06 18:25:05 +02:00
widest_int diff = arg_cand->index - basis->index;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
feeding_def = create_add_on_incoming_edge (c, basis_name, diff,
e, loc, known_stride);
}
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Because of recursion, we need to save the arguments in a vector
so we can create the PHI statement all at once. Otherwise the
storage for the half-created PHI can be reclaimed. */
phi_args.safe_push (feeding_def);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Create the new phi basis. */
name = make_temp_ssa_name (TREE_TYPE (basis_name), NULL, "slsr");
phi = create_phi_node (name, phi_bb);
SSA_NAME_DEF_STMT (name) = phi;
FOR_EACH_VEC_ELT (phi_args, i, phi_arg)
{
edge e = (*phi_bb->preds)[i];
add_phi_arg (phi, phi_arg, e, loc);
}
update_stmt (phi);
if (dump_file && (dump_flags & TDF_DETAILS))
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
fputs ("Introducing new phi basis: ", dump_file);
print_gimple_stmt (dump_file, phi, 0, 0);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return name;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Given a candidate C whose basis is hidden by at least one intervening
phi, introduce a matching number of new phis to represent its basis
adjusted by conditional increments along possible incoming paths. Then
replace C as though it were an unconditional candidate, using the new
basis. */
static void
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
replace_conditional_candidate (slsr_cand_t c)
{
tree basis_name, name;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
slsr_cand_t basis;
location_t loc;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Look up the LHS SSA name from C's basis. This will be the
RHS1 of the adds we will introduce to create new phi arguments. */
basis = lookup_cand (c->basis);
basis_name = gimple_assign_lhs (basis->cand_stmt);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Create a new phi statement which will represent C's true basis
after the transformation is complete. */
loc = gimple_location (c->cand_stmt);
name = create_phi_basis (c, lookup_cand (c->def_phi)->cand_stmt,
basis_name, loc, KNOWN_STRIDE);
/* Replace C with an add of the new basis phi and a constant. */
2014-05-06 18:25:05 +02:00
widest_int bump = c->index * wi::to_widest (c->stride);
replace_mult_candidate (c, name, bump);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Compute the expected costs of inserting basis adjustments for
candidate C with phi-definition PHI. The cost of inserting
one adjustment is given by ONE_ADD_COST. If PHI has arguments
which are themselves phi results, recursively calculate costs
for those phis as well. */
static int
phi_add_costs (gimple *phi, slsr_cand_t c, int one_add_cost)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
unsigned i;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
int cost = 0;
slsr_cand_t phi_cand = *stmt_cand_map->get (phi);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* If we work our way back to a phi that isn't dominated by the hidden
basis, this isn't a candidate for replacement. Indicate this by
returning an unreasonably high cost. It's not easy to detect
these situations when determining the basis, so we defer the
decision until now. */
basic_block phi_bb = gimple_bb (phi);
slsr_cand_t basis = lookup_cand (c->basis);
basic_block basis_bb = gimple_bb (basis->cand_stmt);
if (phi_bb == basis_bb || !dominated_by_p (CDI_DOMINATORS, phi_bb, basis_bb))
return COST_INFINITE;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = gimple_phi_arg_def (phi, i);
if (arg != phi_cand->base_expr)
{
gimple *arg_def = SSA_NAME_DEF_STMT (arg);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (gimple_code (arg_def) == GIMPLE_PHI)
cost += phi_add_costs (arg_def, c, one_add_cost);
else
{
slsr_cand_t arg_cand = base_cand_from_table (arg);
if (arg_cand->index != c->index)
cost += one_add_cost;
}
}
}
return cost;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* For candidate C, each sibling of candidate C, and each dependent of
candidate C, determine whether the candidate is dependent upon a
phi that hides its basis. If not, replace the candidate unconditionally.
Otherwise, determine whether the cost of introducing compensation code
for the candidate is offset by the gains from strength reduction. If
so, replace the candidate and introduce the compensation code. */
static void
replace_uncond_cands_and_profitable_phis (slsr_cand_t c)
{
if (phi_dependent_cand_p (c))
{
if (c->kind == CAND_MULT)
{
/* A candidate dependent upon a phi will replace a multiply by
a constant with an add, and will insert at most one add for
each phi argument. Add these costs with the potential dead-code
savings to determine profitability. */
bool speed = optimize_bb_for_speed_p (gimple_bb (c->cand_stmt));
int mult_savings = stmt_cost (c->cand_stmt, speed);
gimple *phi = lookup_cand (c->def_phi)->cand_stmt;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
tree phi_result = gimple_phi_result (phi);
int one_add_cost = add_cost (speed,
TYPE_MODE (TREE_TYPE (phi_result)));
int add_costs = one_add_cost + phi_add_costs (phi, c, one_add_cost);
int cost = add_costs - mult_savings - c->dead_savings;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Conditional candidate %d:\n", c->cand_num);
fprintf (dump_file, " add_costs = %d\n", add_costs);
fprintf (dump_file, " mult_savings = %d\n", mult_savings);
fprintf (dump_file, " dead_savings = %d\n", c->dead_savings);
fprintf (dump_file, " cost = %d\n", cost);
if (cost <= COST_NEUTRAL)
fputs (" Replacing...\n", dump_file);
else
fputs (" Not replaced.\n", dump_file);
}
if (cost <= COST_NEUTRAL)
replace_conditional_candidate (c);
}
}
else
replace_unconditional_candidate (c);
if (c->sibling)
replace_uncond_cands_and_profitable_phis (lookup_cand (c->sibling));
if (c->dependent)
replace_uncond_cands_and_profitable_phis (lookup_cand (c->dependent));
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Count the number of candidates in the tree rooted at C that have
not already been replaced under other interpretations. */
static int
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
count_candidates (slsr_cand_t c)
{
unsigned count = cand_already_replaced (c) ? 0 : 1;
if (c->sibling)
count += count_candidates (lookup_cand (c->sibling));
if (c->dependent)
count += count_candidates (lookup_cand (c->dependent));
return count;
}
/* Increase the count of INCREMENT by one in the increment vector.
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
INCREMENT is associated with candidate C. If INCREMENT is to be
conditionally executed as part of a conditional candidate replacement,
IS_PHI_ADJUST is true, otherwise false. If an initializer
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
T_0 = stride * I is provided by a candidate that dominates all
candidates with the same increment, also record T_0 for subsequent use. */
static void
2014-05-06 18:25:05 +02:00
record_increment (slsr_cand_t c, widest_int increment, bool is_phi_adjust)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
bool found = false;
unsigned i;
/* Treat increments that differ only in sign as identical so as to
share initializers, unless we are generating pointer arithmetic. */
2014-05-06 18:25:05 +02:00
if (!address_arithmetic_p && wi::neg_p (increment))
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
increment = -increment;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
for (i = 0; i < incr_vec_len; i++)
{
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
if (incr_vec[i].incr == increment)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
incr_vec[i].count++;
found = true;
/* If we previously recorded an initializer that doesn't
dominate this candidate, it's not going to be useful to
us after all. */
if (incr_vec[i].initializer
&& !dominated_by_p (CDI_DOMINATORS,
gimple_bb (c->cand_stmt),
incr_vec[i].init_bb))
{
incr_vec[i].initializer = NULL_TREE;
incr_vec[i].init_bb = NULL;
}
break;
}
}
if (!found && incr_vec_len < MAX_INCR_VEC_LEN - 1)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
/* The first time we see an increment, create the entry for it.
If this is the root candidate which doesn't have a basis, set
the count to zero. We're only processing it so it can possibly
provide an initializer for other candidates. */
incr_vec[incr_vec_len].incr = increment;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
incr_vec[incr_vec_len].count = c->basis || is_phi_adjust ? 1 : 0;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec[incr_vec_len].cost = COST_INFINITE;
/* Optimistically record the first occurrence of this increment
as providing an initializer (if it does); we will revise this
opinion later if it doesn't dominate all other occurrences.
Exception: increments of 0, 1 never need initializers;
and phi adjustments don't ever provide initializers. */
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (c->kind == CAND_ADD
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
&& !is_phi_adjust
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
&& c->index == increment
&& (increment > 1 || increment < 0)
&& (gimple_assign_rhs_code (c->cand_stmt) == PLUS_EXPR
|| gimple_assign_rhs_code (c->cand_stmt) == POINTER_PLUS_EXPR))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
tree t0 = NULL_TREE;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
tree rhs1 = gimple_assign_rhs1 (c->cand_stmt);
tree rhs2 = gimple_assign_rhs2 (c->cand_stmt);
if (operand_equal_p (rhs1, c->base_expr, 0))
t0 = rhs2;
else if (operand_equal_p (rhs2, c->base_expr, 0))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
t0 = rhs1;
if (t0
&& SSA_NAME_DEF_STMT (t0)
&& gimple_bb (SSA_NAME_DEF_STMT (t0)))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
incr_vec[incr_vec_len].initializer = t0;
incr_vec[incr_vec_len++].init_bb
= gimple_bb (SSA_NAME_DEF_STMT (t0));
}
else
{
incr_vec[incr_vec_len].initializer = NULL_TREE;
incr_vec[incr_vec_len++].init_bb = NULL;
}
}
else
{
incr_vec[incr_vec_len].initializer = NULL_TREE;
incr_vec[incr_vec_len++].init_bb = NULL;
}
}
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Given phi statement PHI that hides a candidate from its BASIS, find
the increments along each incoming arc (recursively handling additional
phis that may be present) and record them. These increments are the
difference in index between the index-adjusting statements and the
index of the basis. */
static void
record_phi_increments (slsr_cand_t basis, gimple *phi)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
unsigned i;
slsr_cand_t phi_cand = *stmt_cand_map->get (phi);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = gimple_phi_arg_def (phi, i);
if (!operand_equal_p (arg, phi_cand->base_expr, 0))
{
gimple *arg_def = SSA_NAME_DEF_STMT (arg);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (gimple_code (arg_def) == GIMPLE_PHI)
record_phi_increments (basis, arg_def);
else
{
slsr_cand_t arg_cand = base_cand_from_table (arg);
2014-05-06 18:25:05 +02:00
widest_int diff = arg_cand->index - basis->index;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
record_increment (arg_cand, diff, PHI_ADJUST);
}
}
}
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Determine how many times each unique increment occurs in the set
of candidates rooted at C's parent, recording the data in the
increment vector. For each unique increment I, if an initializer
T_0 = stride * I is provided by a candidate that dominates all
candidates with the same increment, also record T_0 for subsequent
use. */
static void
record_increments (slsr_cand_t c)
{
if (!cand_already_replaced (c))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
if (!phi_dependent_cand_p (c))
record_increment (c, cand_increment (c), NOT_PHI_ADJUST);
else
{
/* A candidate with a basis hidden by a phi will have one
increment for its relationship to the index represented by
the phi, and potentially additional increments along each
incoming edge. For the root of the dependency tree (which
has no basis), process just the initial index in case it has
an initializer that can be used by subsequent candidates. */
record_increment (c, c->index, NOT_PHI_ADJUST);
if (c->basis)
record_phi_increments (lookup_cand (c->basis),
lookup_cand (c->def_phi)->cand_stmt);
}
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (c->sibling)
record_increments (lookup_cand (c->sibling));
if (c->dependent)
record_increments (lookup_cand (c->dependent));
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Add up and return the costs of introducing add statements that
require the increment INCR on behalf of candidate C and phi
statement PHI. Accumulate into *SAVINGS the potential savings
from removing existing statements that feed PHI and have no other
uses. */
static int
phi_incr_cost (slsr_cand_t c, const widest_int &incr, gimple *phi,
int *savings)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
unsigned i;
int cost = 0;
slsr_cand_t basis = lookup_cand (c->basis);
slsr_cand_t phi_cand = *stmt_cand_map->get (phi);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = gimple_phi_arg_def (phi, i);
if (!operand_equal_p (arg, phi_cand->base_expr, 0))
{
gimple *arg_def = SSA_NAME_DEF_STMT (arg);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (gimple_code (arg_def) == GIMPLE_PHI)
{
int feeding_savings = 0;
cost += phi_incr_cost (c, incr, arg_def, &feeding_savings);
if (has_single_use (gimple_phi_result (arg_def)))
*savings += feeding_savings;
}
else
{
slsr_cand_t arg_cand = base_cand_from_table (arg);
2014-05-06 18:25:05 +02:00
widest_int diff = arg_cand->index - basis->index;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (incr == diff)
{
tree basis_lhs = gimple_assign_lhs (basis->cand_stmt);
tree lhs = gimple_assign_lhs (arg_cand->cand_stmt);
cost += add_cost (true, TYPE_MODE (TREE_TYPE (basis_lhs)));
if (has_single_use (lhs))
*savings += stmt_cost (arg_cand->cand_stmt, true);
}
}
}
}
return cost;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Return the first candidate in the tree rooted at C that has not
already been replaced, favoring siblings over dependents. */
static slsr_cand_t
unreplaced_cand_in_tree (slsr_cand_t c)
{
if (!cand_already_replaced (c))
return c;
if (c->sibling)
{
slsr_cand_t sib = unreplaced_cand_in_tree (lookup_cand (c->sibling));
if (sib)
return sib;
}
if (c->dependent)
{
slsr_cand_t dep = unreplaced_cand_in_tree (lookup_cand (c->dependent));
if (dep)
return dep;
}
return NULL;
}
/* Return TRUE if the candidates in the tree rooted at C should be
optimized for speed, else FALSE. We estimate this based on the block
containing the most dominant candidate in the tree that has not yet
been replaced. */
static bool
optimize_cands_for_speed_p (slsr_cand_t c)
{
slsr_cand_t c2 = unreplaced_cand_in_tree (c);
gcc_assert (c2);
return optimize_bb_for_speed_p (gimple_bb (c2->cand_stmt));
}
/* Add COST_IN to the lowest cost of any dependent path starting at
candidate C or any of its siblings, counting only candidates along
such paths with increment INCR. Assume that replacing a candidate
reduces cost by REPL_SAVINGS. Also account for savings from any
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
statements that would go dead. If COUNT_PHIS is true, include
costs of introducing feeding statements for conditional candidates. */
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
static int
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
lowest_cost_path (int cost_in, int repl_savings, slsr_cand_t c,
2014-05-06 18:25:05 +02:00
const widest_int &incr, bool count_phis)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
int local_cost, sib_cost, savings = 0;
2014-05-06 18:25:05 +02:00
widest_int cand_incr = cand_abs_increment (c);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (cand_already_replaced (c))
local_cost = cost_in;
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
else if (incr == cand_incr)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
local_cost = cost_in - repl_savings - c->dead_savings;
else
local_cost = cost_in - c->dead_savings;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (count_phis
&& phi_dependent_cand_p (c)
&& !cand_already_replaced (c))
{
gimple *phi = lookup_cand (c->def_phi)->cand_stmt;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
local_cost += phi_incr_cost (c, incr, phi, &savings);
if (has_single_use (gimple_phi_result (phi)))
local_cost -= savings;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (c->dependent)
local_cost = lowest_cost_path (local_cost, repl_savings,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
lookup_cand (c->dependent), incr,
count_phis);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (c->sibling)
{
sib_cost = lowest_cost_path (cost_in, repl_savings,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
lookup_cand (c->sibling), incr,
count_phis);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
local_cost = MIN (local_cost, sib_cost);
}
return local_cost;
}
/* Compute the total savings that would accrue from all replacements
in the candidate tree rooted at C, counting only candidates with
increment INCR. Assume that replacing a candidate reduces cost
by REPL_SAVINGS. Also account for savings from statements that
would go dead. */
static int
2014-05-06 18:25:05 +02:00
total_savings (int repl_savings, slsr_cand_t c, const widest_int &incr,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
bool count_phis)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
int savings = 0;
2014-05-06 18:25:05 +02:00
widest_int cand_incr = cand_abs_increment (c);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
if (incr == cand_incr && !cand_already_replaced (c))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
savings += repl_savings + c->dead_savings;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (count_phis
&& phi_dependent_cand_p (c)
&& !cand_already_replaced (c))
{
int phi_savings = 0;
gimple *phi = lookup_cand (c->def_phi)->cand_stmt;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
savings -= phi_incr_cost (c, incr, phi, &phi_savings);
if (has_single_use (gimple_phi_result (phi)))
savings += phi_savings;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (c->dependent)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
savings += total_savings (repl_savings, lookup_cand (c->dependent), incr,
count_phis);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (c->sibling)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
savings += total_savings (repl_savings, lookup_cand (c->sibling), incr,
count_phis);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
return savings;
}
/* Use target-specific costs to determine and record which increments
in the current candidate tree are profitable to replace, assuming
MODE and SPEED. FIRST_DEP is the first dependent of the root of
the candidate tree.
One slight limitation here is that we don't account for the possible
introduction of casts in some cases. See replace_one_candidate for
the cases where these are introduced. This should probably be cleaned
up sometime. */
static void
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
analyze_increments (slsr_cand_t first_dep, machine_mode mode, bool speed)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
unsigned i;
for (i = 0; i < incr_vec_len; i++)
{
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
HOST_WIDE_INT incr = incr_vec[i].incr.to_shwi ();
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* If somehow this increment is bigger than a HWI, we won't
be optimizing candidates that use it. And if the increment
has a count of zero, nothing will be done with it. */
2014-05-06 18:25:05 +02:00
if (!wi::fits_shwi_p (incr_vec[i].incr) || !incr_vec[i].count)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec[i].cost = COST_INFINITE;
/* Increments of 0, 1, and -1 are always profitable to replace,
because they always replace a multiply or add with an add or
copy, and may cause one or more existing instructions to go
dead. Exception: -1 can't be assumed to be profitable for
pointer addition. */
else if (incr == 0
|| incr == 1
|| (incr == -1
&& !POINTER_TYPE_P (first_dep->cand_type)))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec[i].cost = COST_NEUTRAL;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
/* If we need to add an initializer, give up if a cast from the
candidate's type to its stride's type can lose precision.
Note that this already takes into account that the stride may
have been cast to a wider type, in which case this test won't
fire. Example:
short int _1;
_2 = (int) _1;
_3 = _2 * 10;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
_4 = x + _3; ADD: x + (10 * (int)_1) : int
_5 = _2 * 15;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
_6 = x + _5; ADD: x + (15 * (int)_1) : int
Although the stride was a short int initially, the stride
used in the analysis has been widened to an int, and such
widening will be done in the initializer as well. */
else if (!incr_vec[i].initializer
&& TREE_CODE (first_dep->stride) != INTEGER_CST
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
&& !legal_cast_p_1 (first_dep->stride_type,
TREE_TYPE (gimple_assign_lhs
(first_dep->cand_stmt))))
incr_vec[i].cost = COST_INFINITE;
/* If we need to add an initializer, make sure we don't introduce
a multiply by a pointer type, which can happen in certain cast
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
scenarios. */
else if (!incr_vec[i].initializer
&& TREE_CODE (first_dep->stride) != INTEGER_CST
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
&& POINTER_TYPE_P (first_dep->stride_type))
incr_vec[i].cost = COST_INFINITE;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* For any other increment, if this is a multiply candidate, we
must introduce a temporary T and initialize it with
T_0 = stride * increment. When optimizing for speed, walk the
candidate tree to calculate the best cost reduction along any
path; if it offsets the fixed cost of inserting the initializer,
replacing the increment is profitable. When optimizing for
size, instead calculate the total cost reduction from replacing
all candidates with this increment. */
else if (first_dep->kind == CAND_MULT)
{
int cost = mult_by_coeff_cost (incr, mode, speed);
int repl_savings = mul_cost (speed, mode) - add_cost (speed, mode);
if (speed)
cost = lowest_cost_path (cost, repl_savings, first_dep,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
incr_vec[i].incr, COUNT_PHIS);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
else
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
cost -= total_savings (repl_savings, first_dep, incr_vec[i].incr,
COUNT_PHIS);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec[i].cost = cost;
}
/* If this is an add candidate, the initializer may already
exist, so only calculate the cost of the initializer if it
doesn't. We are replacing one add with another here, so the
known replacement savings is zero. We will account for removal
of dead instructions in lowest_cost_path or total_savings. */
else
{
int cost = 0;
if (!incr_vec[i].initializer)
cost = mult_by_coeff_cost (incr, mode, speed);
if (speed)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
cost = lowest_cost_path (cost, 0, first_dep, incr_vec[i].incr,
DONT_COUNT_PHIS);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
else
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
cost -= total_savings (0, first_dep, incr_vec[i].incr,
DONT_COUNT_PHIS);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec[i].cost = cost;
}
}
}
/* Return the nearest common dominator of BB1 and BB2. If the blocks
are identical, return the earlier of C1 and C2 in *WHERE. Otherwise,
if the NCD matches BB1, return C1 in *WHERE; if the NCD matches BB2,
return C2 in *WHERE; and if the NCD matches neither, return NULL in
*WHERE. Note: It is possible for one of C1 and C2 to be NULL. */
static basic_block
ncd_for_two_cands (basic_block bb1, basic_block bb2,
slsr_cand_t c1, slsr_cand_t c2, slsr_cand_t *where)
{
basic_block ncd;
if (!bb1)
{
*where = c2;
return bb2;
}
if (!bb2)
{
*where = c1;
return bb1;
}
ncd = nearest_common_dominator (CDI_DOMINATORS, bb1, bb2);
/* If both candidates are in the same block, the earlier
candidate wins. */
if (bb1 == ncd && bb2 == ncd)
{
if (!c1 || (c2 && c2->cand_num < c1->cand_num))
*where = c2;
else
*where = c1;
}
/* Otherwise, if one of them produced a candidate in the
dominator, that one wins. */
else if (bb1 == ncd)
*where = c1;
else if (bb2 == ncd)
*where = c2;
/* If neither matches the dominator, neither wins. */
else
*where = NULL;
return ncd;
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Consider all candidates that feed PHI. Find the nearest common
dominator of those candidates requiring the given increment INCR.
Further find and return the nearest common dominator of this result
with block NCD. If the returned block contains one or more of the
candidates, return the earliest candidate in the block in *WHERE. */
static basic_block
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
ncd_with_phi (slsr_cand_t c, const widest_int &incr, gphi *phi,
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
basic_block ncd, slsr_cand_t *where)
{
unsigned i;
slsr_cand_t basis = lookup_cand (c->basis);
slsr_cand_t phi_cand = *stmt_cand_map->get (phi);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = gimple_phi_arg_def (phi, i);
if (!operand_equal_p (arg, phi_cand->base_expr, 0))
{
gimple *arg_def = SSA_NAME_DEF_STMT (arg);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (gimple_code (arg_def) == GIMPLE_PHI)
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
ncd = ncd_with_phi (c, incr, as_a <gphi *> (arg_def), ncd,
where);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
else
{
slsr_cand_t arg_cand = base_cand_from_table (arg);
2014-05-06 18:25:05 +02:00
widest_int diff = arg_cand->index - basis->index;
basic_block pred = gimple_phi_arg_edge (phi, i)->src;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if ((incr == diff) || (!address_arithmetic_p && incr == -diff))
ncd = ncd_for_two_cands (ncd, pred, *where, NULL, where);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
}
}
return ncd;
}
/* Consider the candidate C together with any candidates that feed
C's phi dependence (if any). Find and return the nearest common
dominator of those candidates requiring the given increment INCR.
If the returned block contains one or more of the candidates,
return the earliest candidate in the block in *WHERE. */
static basic_block
2014-05-06 18:25:05 +02:00
ncd_of_cand_and_phis (slsr_cand_t c, const widest_int &incr, slsr_cand_t *where)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
basic_block ncd = NULL;
if (cand_abs_increment (c) == incr)
{
ncd = gimple_bb (c->cand_stmt);
*where = c;
}
if (phi_dependent_cand_p (c))
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
ncd = ncd_with_phi (c, incr,
as_a <gphi *> (lookup_cand (c->def_phi)->cand_stmt),
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
ncd, where);
return ncd;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Consider all candidates in the tree rooted at C for which INCR
represents the required increment of C relative to its basis.
Find and return the basic block that most nearly dominates all
such candidates. If the returned block contains one or more of
the candidates, return the earliest candidate in the block in
*WHERE. */
static basic_block
2014-05-06 18:25:05 +02:00
nearest_common_dominator_for_cands (slsr_cand_t c, const widest_int &incr,
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
slsr_cand_t *where)
{
basic_block sib_ncd = NULL, dep_ncd = NULL, this_ncd = NULL, ncd;
slsr_cand_t sib_where = NULL, dep_where = NULL, this_where = NULL, new_where;
/* First find the NCD of all siblings and dependents. */
if (c->sibling)
sib_ncd = nearest_common_dominator_for_cands (lookup_cand (c->sibling),
incr, &sib_where);
if (c->dependent)
dep_ncd = nearest_common_dominator_for_cands (lookup_cand (c->dependent),
incr, &dep_where);
if (!sib_ncd && !dep_ncd)
{
new_where = NULL;
ncd = NULL;
}
else if (sib_ncd && !dep_ncd)
{
new_where = sib_where;
ncd = sib_ncd;
}
else if (dep_ncd && !sib_ncd)
{
new_where = dep_where;
ncd = dep_ncd;
}
else
ncd = ncd_for_two_cands (sib_ncd, dep_ncd, sib_where,
dep_where, &new_where);
/* If the candidate's increment doesn't match the one we're interested
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
in (and nor do any increments for feeding defs of a phi-dependence),
then the result depends only on siblings and dependents. */
this_ncd = ncd_of_cand_and_phis (c, incr, &this_where);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (!this_ncd || cand_already_replaced (c))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
*where = new_where;
return ncd;
}
/* Otherwise, compare this candidate with the result from all siblings
and dependents. */
ncd = ncd_for_two_cands (ncd, this_ncd, new_where, this_where, where);
return ncd;
}
/* Return TRUE if the increment indexed by INDEX is profitable to replace. */
static inline bool
profitable_increment_p (unsigned index)
{
return (incr_vec[index].cost <= COST_NEUTRAL);
}
/* For each profitable increment in the increment vector not equal to
0 or 1 (or -1, for non-pointer arithmetic), find the nearest common
dominator of all statements in the candidate chain rooted at C
that require that increment, and insert an initializer
T_0 = stride * increment at that location. Record T_0 with the
increment record. */
static void
insert_initializers (slsr_cand_t c)
{
unsigned i;
for (i = 0; i < incr_vec_len; i++)
{
basic_block bb;
slsr_cand_t where = 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
gassign *init_stmt;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
gassign *cast_stmt = NULL;
tree new_name, incr_tree, init_stride;
2014-05-06 18:25:05 +02:00
widest_int incr = incr_vec[i].incr;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (!profitable_increment_p (i)
2014-05-06 18:25:05 +02:00
|| incr == 1
|| (incr == -1
&& (!POINTER_TYPE_P (lookup_cand (c->basis)->cand_type)))
2014-05-06 18:25:05 +02:00
|| incr == 0)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
continue;
/* We may have already identified an existing initializer that
will suffice. */
if (incr_vec[i].initializer)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("Using existing initializer: ", dump_file);
print_gimple_stmt (dump_file,
SSA_NAME_DEF_STMT (incr_vec[i].initializer),
0, 0);
}
continue;
}
/* Find the block that most closely dominates all candidates
with this increment. If there is at least one candidate in
that block, the earliest one will be returned in WHERE. */
bb = nearest_common_dominator_for_cands (c, incr, &where);
/* If the NCD is not dominated by the block containing the
definition of the stride, we can't legally insert a
single initializer. Mark the increment as unprofitable
so we don't make any replacements. FIXME: Multiple
initializers could be placed with more analysis. */
gimple *stride_def = SSA_NAME_DEF_STMT (c->stride);
basic_block stride_bb = gimple_bb (stride_def);
if (stride_bb && !dominated_by_p (CDI_DOMINATORS, bb, stride_bb))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
"Initializer #%d cannot be legally placed\n", i);
incr_vec[i].cost = COST_INFINITE;
continue;
}
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
/* If the nominal stride has a different type than the recorded
stride type, build a cast from the nominal stride to that type. */
if (!types_compatible_p (TREE_TYPE (c->stride), c->stride_type))
{
init_stride = make_temp_ssa_name (c->stride_type, NULL, "slsr");
cast_stmt = gimple_build_assign (init_stride, NOP_EXPR, c->stride);
}
else
init_stride = c->stride;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Create a new SSA name to hold the initializer's value. */
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
new_name = make_temp_ssa_name (c->stride_type, NULL, "slsr");
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec[i].initializer = new_name;
/* Create the initializer and insert it in the latest possible
dominating position. */
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
incr_tree = wide_int_to_tree (c->stride_type, incr);
gimple.h (gimple_build_assign_stat): Remove prototype. * gimple.h (gimple_build_assign_stat): Remove prototype. (gimple_build_assign): Remove define. Add overload prototypes with tree lhs and either a tree rhs, or enum tree_code and 1, 2 or 3 tree operands. * gimple.c (gimple_build_assign_stat): Renamed to... (gimple_build_assign): ... this. Add overloads with enum tree_code and 1, 2 or 3 tree operands. (gimple_build_assign_with_ops): Remove 1 and 2 operand overloads. Rename the 3 operand overload to ... (gimple_build_assign_1): ... this. Make it static inline. * tree-ssa-strlen.c (get_string_length): Use gimple_build_assign instead of gimple_build_assign_with_ops, swap the order of first two arguments and adjust formatting where necessary. * tree-vect-slp.c (vect_get_constant_vectors, vect_create_mask_and_perm): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_builtin_call): Likewise. * tree-chkp.c (chkp_compute_bounds_for_assignment, chkp_generate_extern_var_bounds): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. * value-prof.c (gimple_divmod_fixed_value, gimple_mod_pow2, gimple_mod_subtract): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern, vect_recog_sad_pattern, vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_recog_pow_pattern, vect_recog_widen_sum_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern, vect_recog_widen_shift_pattern, vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern, vect_recog_divmod_pattern, vect_recog_mixed_size_cond_pattern, adjust_bool_pattern_cast, adjust_bool_pattern, vect_recog_bool_pattern): Likewise. * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge, insert_initializers, introduce_cast_before_cand, replace_one_candidate): Likewise. * tree-ssa-math-opts.c (insert_reciprocals, powi_as_mults_1, powi_as_mults, build_and_insert_binop, build_and_insert_cast, pass_cse_sincos::execute, bswap_replace, convert_mult_to_fma): Likewise. * tree-tailcall.c (adjust_return_value_with_ops, update_accumulator_with_ops): Likewise. * tree-predcom.c (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, attempt_builtin_powi, reassociate_bb): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-ssa-phiopt.c (conditional_replacement, minmax_replacement, abs_replacement, neg_replacement): Likewise. * tree-profile.c (gimple_gen_edge_profiler): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * gimple-fold.c (rewrite_to_defined_overflow, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_bool_enum_load): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. * omp-low.c (lower_rec_input_clauses, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_cilk_for, simd_clone_adjust): Likewise. * trans-mem.c (expand_transaction): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_permute_store_chain, vect_setup_realignment, vect_permute_load_chain, vect_shift_permute_load_chain): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_simd_clone_call, vect_gen_widened_results_half, vect_create_vectorized_demotion_stmts, vectorizable_conversion, vectorizable_shift, vectorizable_operation, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. From-SVN: r218216
2014-12-01 14:58:10 +01:00
init_stmt = gimple_build_assign (new_name, MULT_EXPR,
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
init_stride, incr_tree);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (where)
{
gimple_stmt_iterator gsi = gsi_for_stmt (where->cand_stmt);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
location_t loc = gimple_location (where->cand_stmt);
if (cast_stmt)
{
gsi_insert_before (&gsi, cast_stmt, GSI_SAME_STMT);
gimple_set_location (cast_stmt, loc);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gsi_insert_before (&gsi, init_stmt, GSI_SAME_STMT);
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
gimple_set_location (init_stmt, loc);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
}
else
{
gimple_stmt_iterator gsi = gsi_last_bb (bb);
gimple *basis_stmt = lookup_cand (c->basis)->cand_stmt;
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
location_t loc = gimple_location (basis_stmt);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (!gsi_end_p (gsi) && stmt_ends_bb_p (gsi_stmt (gsi)))
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
{
if (cast_stmt)
{
gsi_insert_before (&gsi, cast_stmt, GSI_SAME_STMT);
gimple_set_location (cast_stmt, loc);
}
gsi_insert_before (&gsi, init_stmt, GSI_SAME_STMT);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
else
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
{
if (cast_stmt)
{
gsi_insert_after (&gsi, cast_stmt, GSI_NEW_STMT);
gimple_set_location (cast_stmt, loc);
}
gsi_insert_after (&gsi, init_stmt, GSI_SAME_STMT);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_set_location (init_stmt, gimple_location (basis_stmt));
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
re PR tree-optimization/71915 (A missed opportunity for SLSR) [gcc] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gimple-ssa-strength-reduction.c (struct slsr_cand_d): Add stride_type field. (find_basis_for_base_expr): Require stride types to match when seeking a basis. (alloc_cand_and_find_basis): Record the stride type. (slsr_process_phi): Pass stride type to alloc_cand_and_find_basis. (backtrace_base_for_ref): Pass types to legal_cast_p_1 rather than the expressions having those types. (slsr_process_ref): Pass stride type to alloc_cand_and_find_basis. (create_mul_ssa_cand): Likewise. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Likewise. (create_add_imm_cand): Likewise. (legal_cast_p_1): Change interface to accept types rather than the expressions having those types. (legal_cast_p): Pass types to legal_cast_p_1. (slsr_process_cast): Pass stride type to alloc_cand_and_find_basis. (slsr_process_copy): Likewise. (dump_candidate): Display stride type when a cast exists. (create_add_on_incoming_edge): Introduce a cast when necessary for the stride type. (analyze_increments): Change the code checking for invalid casts to rely on the stride type, and update the documentation and example. Change the code checking for pointer multiplies to rely on the stride type. (insert_initializers): Introduce a cast when necessary for the stride type. Use the stride type for the type of the initializer. [gcc/testsuite] 2016-10-30 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR tree-optimization/71915 PR tree-optimization/71490 * gcc.dg/tree-ssa/pr54245.c: Delete. * gcc.dg/tree-ssa/slsr-8.c: Adjust for new optimization and document why. From-SVN: r241695
2016-10-31 04:04:59 +01:00
if (cast_stmt)
{
fputs ("Inserting stride cast: ", dump_file);
print_gimple_stmt (dump_file, cast_stmt, 0, 0);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
fputs ("Inserting initializer: ", dump_file);
print_gimple_stmt (dump_file, init_stmt, 0, 0);
}
}
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* Return TRUE iff all required increments for candidates feeding PHI
are profitable (and legal!) to replace on behalf of candidate C. */
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
static bool
all_phi_incrs_profitable (slsr_cand_t c, gphi *phi)
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
{
unsigned i;
slsr_cand_t basis = lookup_cand (c->basis);
slsr_cand_t phi_cand = *stmt_cand_map->get (phi);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* If the basis doesn't dominate the PHI (including when the PHI is
in the same block as the basis), we won't be able to create a PHI
using the basis here. */
basic_block basis_bb = gimple_bb (basis->cand_stmt);
basic_block phi_bb = gimple_bb (phi);
if (phi_bb == basis_bb
|| !dominated_by_p (CDI_DOMINATORS, phi_bb, basis_bb))
return false;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
/* If the PHI arg resides in a block not dominated by the basis,
we won't be able to create a PHI using the basis here. */
basic_block pred_bb = gimple_phi_arg_edge (phi, i)->src;
if (!dominated_by_p (CDI_DOMINATORS, pred_bb, basis_bb))
return false;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
tree arg = gimple_phi_arg_def (phi, i);
if (!operand_equal_p (arg, phi_cand->base_expr, 0))
{
gimple *arg_def = SSA_NAME_DEF_STMT (arg);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (gimple_code (arg_def) == GIMPLE_PHI)
{
if (!all_phi_incrs_profitable (c, as_a <gphi *> (arg_def)))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return false;
}
else
{
int j;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
slsr_cand_t arg_cand = base_cand_from_table (arg);
2014-05-06 18:25:05 +02:00
widest_int increment = arg_cand->index - basis->index;
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
2014-05-06 18:25:05 +02:00
if (!address_arithmetic_p && wi::neg_p (increment))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
increment = -increment;
j = incr_vec_index (increment);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Conditional candidate %d, phi: ",
c->cand_num);
print_gimple_stmt (dump_file, phi, 0, 0);
fputs (" increment: ", dump_file);
2014-05-06 18:25:05 +02:00
print_decs (increment, dump_file);
if (j < 0)
fprintf (dump_file,
"\n Not replaced; incr_vec overflow.\n");
else {
fprintf (dump_file, "\n cost: %d\n", incr_vec[j].cost);
if (profitable_increment_p (j))
fputs (" Replacing...\n", dump_file);
else
fputs (" Not replaced.\n", dump_file);
}
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
if (j < 0 || !profitable_increment_p (j))
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
return false;
}
}
}
return true;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* Create a NOP_EXPR that copies FROM_EXPR into a new SSA name of
type TO_TYPE, and insert it in front of the statement represented
by candidate C. Use *NEW_VAR to create the new SSA name. Return
the new SSA name. */
static tree
introduce_cast_before_cand (slsr_cand_t c, tree to_type, tree from_expr)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
tree cast_lhs;
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
gassign *cast_stmt;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
cast_lhs = make_temp_ssa_name (to_type, NULL, "slsr");
gimple.h (gimple_build_assign_stat): Remove prototype. * gimple.h (gimple_build_assign_stat): Remove prototype. (gimple_build_assign): Remove define. Add overload prototypes with tree lhs and either a tree rhs, or enum tree_code and 1, 2 or 3 tree operands. * gimple.c (gimple_build_assign_stat): Renamed to... (gimple_build_assign): ... this. Add overloads with enum tree_code and 1, 2 or 3 tree operands. (gimple_build_assign_with_ops): Remove 1 and 2 operand overloads. Rename the 3 operand overload to ... (gimple_build_assign_1): ... this. Make it static inline. * tree-ssa-strlen.c (get_string_length): Use gimple_build_assign instead of gimple_build_assign_with_ops, swap the order of first two arguments and adjust formatting where necessary. * tree-vect-slp.c (vect_get_constant_vectors, vect_create_mask_and_perm): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_builtin_call): Likewise. * tree-chkp.c (chkp_compute_bounds_for_assignment, chkp_generate_extern_var_bounds): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. * value-prof.c (gimple_divmod_fixed_value, gimple_mod_pow2, gimple_mod_subtract): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern, vect_recog_sad_pattern, vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_recog_pow_pattern, vect_recog_widen_sum_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern, vect_recog_widen_shift_pattern, vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern, vect_recog_divmod_pattern, vect_recog_mixed_size_cond_pattern, adjust_bool_pattern_cast, adjust_bool_pattern, vect_recog_bool_pattern): Likewise. * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge, insert_initializers, introduce_cast_before_cand, replace_one_candidate): Likewise. * tree-ssa-math-opts.c (insert_reciprocals, powi_as_mults_1, powi_as_mults, build_and_insert_binop, build_and_insert_cast, pass_cse_sincos::execute, bswap_replace, convert_mult_to_fma): Likewise. * tree-tailcall.c (adjust_return_value_with_ops, update_accumulator_with_ops): Likewise. * tree-predcom.c (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, attempt_builtin_powi, reassociate_bb): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-ssa-phiopt.c (conditional_replacement, minmax_replacement, abs_replacement, neg_replacement): Likewise. * tree-profile.c (gimple_gen_edge_profiler): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * gimple-fold.c (rewrite_to_defined_overflow, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_bool_enum_load): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. * omp-low.c (lower_rec_input_clauses, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_cilk_for, simd_clone_adjust): Likewise. * trans-mem.c (expand_transaction): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_permute_store_chain, vect_setup_realignment, vect_permute_load_chain, vect_shift_permute_load_chain): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_simd_clone_call, vect_gen_widened_results_half, vect_create_vectorized_demotion_stmts, vectorizable_conversion, vectorizable_shift, vectorizable_operation, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. From-SVN: r218216
2014-12-01 14:58:10 +01:00
cast_stmt = gimple_build_assign (cast_lhs, NOP_EXPR, from_expr);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_set_location (cast_stmt, gimple_location (c->cand_stmt));
gsi_insert_before (&gsi, cast_stmt, GSI_SAME_STMT);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs (" Inserting: ", dump_file);
print_gimple_stmt (dump_file, cast_stmt, 0, 0);
}
return cast_lhs;
}
/* Replace the RHS of the statement represented by candidate C with
NEW_CODE, NEW_RHS1, and NEW_RHS2, provided that to do so doesn't
leave C unchanged or just interchange its operands. The original
operation and operands are in OLD_CODE, OLD_RHS1, and OLD_RHS2.
If the replacement was made and we are doing a details dump,
return the revised statement, else NULL. */
static gimple *
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
replace_rhs_if_not_dup (enum tree_code new_code, tree new_rhs1, tree new_rhs2,
enum tree_code old_code, tree old_rhs1, tree old_rhs2,
slsr_cand_t c)
{
if (new_code != old_code
|| ((!operand_equal_p (new_rhs1, old_rhs1, 0)
|| !operand_equal_p (new_rhs2, old_rhs2, 0))
&& (!operand_equal_p (new_rhs1, old_rhs2, 0)
|| !operand_equal_p (new_rhs2, old_rhs1, 0))))
{
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
slsr_cand_t cc = c;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_assign_set_rhs_with_ops (&gsi, new_code, new_rhs1, new_rhs2);
update_stmt (gsi_stmt (gsi));
c->cand_stmt = gsi_stmt (gsi);
while (cc->next_interp)
{
cc = lookup_cand (cc->next_interp);
cc->cand_stmt = gsi_stmt (gsi);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
return gsi_stmt (gsi);
}
else if (dump_file && (dump_flags & TDF_DETAILS))
fputs (" (duplicate, not actually replacing)\n", dump_file);
return NULL;
}
/* Strength-reduce the statement represented by candidate C by replacing
it with an equivalent addition or subtraction. I is the index into
the increment vector identifying C's increment. NEW_VAR is used to
create a new SSA name if a cast needs to be introduced. BASIS_NAME
is the rhs1 to use in creating the add/subtract. */
static void
replace_one_candidate (slsr_cand_t c, unsigned i, tree basis_name)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
gimple *stmt_to_print = NULL;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
tree orig_rhs1, orig_rhs2;
tree rhs2;
enum tree_code orig_code, repl_code;
2014-05-06 18:25:05 +02:00
widest_int cand_incr;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
orig_code = gimple_assign_rhs_code (c->cand_stmt);
orig_rhs1 = gimple_assign_rhs1 (c->cand_stmt);
orig_rhs2 = gimple_assign_rhs2 (c->cand_stmt);
cand_incr = cand_increment (c);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("Replacing: ", dump_file);
print_gimple_stmt (dump_file, c->cand_stmt, 0, 0);
stmt_to_print = c->cand_stmt;
}
if (address_arithmetic_p)
repl_code = POINTER_PLUS_EXPR;
else
repl_code = PLUS_EXPR;
/* If the increment has an initializer T_0, replace the candidate
statement with an add of the basis name and the initializer. */
if (incr_vec[i].initializer)
{
tree init_type = TREE_TYPE (incr_vec[i].initializer);
tree orig_type = TREE_TYPE (orig_rhs2);
if (types_compatible_p (orig_type, init_type))
rhs2 = incr_vec[i].initializer;
else
rhs2 = introduce_cast_before_cand (c, orig_type,
incr_vec[i].initializer);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
if (incr_vec[i].incr != cand_incr)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
gcc_assert (repl_code == PLUS_EXPR);
repl_code = MINUS_EXPR;
}
stmt_to_print = replace_rhs_if_not_dup (repl_code, basis_name, rhs2,
orig_code, orig_rhs1, orig_rhs2,
c);
}
/* Otherwise, the increment is one of -1, 0, and 1. Replace
with a subtract of the stride from the basis name, a copy
from the basis name, or an add of the stride to the basis
name, respectively. It may be necessary to introduce a
cast (or reuse an existing cast). */
2014-05-06 18:25:05 +02:00
else if (cand_incr == 1)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
tree stride_type = TREE_TYPE (c->stride);
tree orig_type = TREE_TYPE (orig_rhs2);
if (types_compatible_p (orig_type, stride_type))
rhs2 = c->stride;
else
rhs2 = introduce_cast_before_cand (c, orig_type, c->stride);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
stmt_to_print = replace_rhs_if_not_dup (repl_code, basis_name, rhs2,
orig_code, orig_rhs1, orig_rhs2,
c);
}
2014-05-06 18:25:05 +02:00
else if (cand_incr == -1)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
tree stride_type = TREE_TYPE (c->stride);
tree orig_type = TREE_TYPE (orig_rhs2);
gcc_assert (repl_code != POINTER_PLUS_EXPR);
if (types_compatible_p (orig_type, stride_type))
rhs2 = c->stride;
else
rhs2 = introduce_cast_before_cand (c, orig_type, c->stride);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (orig_code != MINUS_EXPR
|| !operand_equal_p (basis_name, orig_rhs1, 0)
|| !operand_equal_p (rhs2, orig_rhs2, 0))
{
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
slsr_cand_t cc = c;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_assign_set_rhs_with_ops (&gsi, MINUS_EXPR, basis_name, rhs2);
update_stmt (gsi_stmt (gsi));
c->cand_stmt = gsi_stmt (gsi);
while (cc->next_interp)
{
cc = lookup_cand (cc->next_interp);
cc->cand_stmt = gsi_stmt (gsi);
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
stmt_to_print = gsi_stmt (gsi);
}
else if (dump_file && (dump_flags & TDF_DETAILS))
fputs (" (duplicate, not actually replacing)\n", dump_file);
}
2014-05-06 18:25:05 +02:00
else if (cand_incr == 0)
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
tree lhs = gimple_assign_lhs (c->cand_stmt);
tree lhs_type = TREE_TYPE (lhs);
tree basis_type = TREE_TYPE (basis_name);
if (types_compatible_p (lhs_type, basis_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
gassign *copy_stmt = gimple_build_assign (lhs, basis_name);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
slsr_cand_t cc = c;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_set_location (copy_stmt, gimple_location (c->cand_stmt));
gsi_replace (&gsi, copy_stmt, false);
c->cand_stmt = copy_stmt;
while (cc->next_interp)
{
cc = lookup_cand (cc->next_interp);
cc->cand_stmt = copy_stmt;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
stmt_to_print = copy_stmt;
}
else
{
gimple_stmt_iterator gsi = gsi_for_stmt (c->cand_stmt);
gimple.h (gimple_build_assign_stat): Remove prototype. * gimple.h (gimple_build_assign_stat): Remove prototype. (gimple_build_assign): Remove define. Add overload prototypes with tree lhs and either a tree rhs, or enum tree_code and 1, 2 or 3 tree operands. * gimple.c (gimple_build_assign_stat): Renamed to... (gimple_build_assign): ... this. Add overloads with enum tree_code and 1, 2 or 3 tree operands. (gimple_build_assign_with_ops): Remove 1 and 2 operand overloads. Rename the 3 operand overload to ... (gimple_build_assign_1): ... this. Make it static inline. * tree-ssa-strlen.c (get_string_length): Use gimple_build_assign instead of gimple_build_assign_with_ops, swap the order of first two arguments and adjust formatting where necessary. * tree-vect-slp.c (vect_get_constant_vectors, vect_create_mask_and_perm): Likewise. * tree-ssa-forwprop.c (simplify_rotate): Likewise. * asan.c (build_shadow_mem_access, maybe_create_ssa_name, maybe_cast_to_ptrmode, asan_expand_check_ifn): Likewise. * tsan.c (instrument_builtin_call): Likewise. * tree-chkp.c (chkp_compute_bounds_for_assignment, chkp_generate_extern_var_bounds): Likewise. * tree-loop-distribution.c (generate_memset_builtin): Likewise. * tree-ssa-loop-im.c (rewrite_reciprocal): Likewise. * gimple-builder.c (build_assign, build_type_cast): Likewise. * tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise. * value-prof.c (gimple_divmod_fixed_value, gimple_mod_pow2, gimple_mod_subtract): Likewise. * gimple-match-head.c (maybe_push_res_to_seq): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern, vect_recog_sad_pattern, vect_handle_widen_op_by_const, vect_recog_widen_mult_pattern, vect_recog_pow_pattern, vect_recog_widen_sum_pattern, vect_operation_fits_smaller_type, vect_recog_over_widening_pattern, vect_recog_widen_shift_pattern, vect_recog_rotate_pattern, vect_recog_vector_vector_shift_pattern, vect_recog_divmod_pattern, vect_recog_mixed_size_cond_pattern, adjust_bool_pattern_cast, adjust_bool_pattern, vect_recog_bool_pattern): Likewise. * gimple-ssa-strength-reduction.c (create_add_on_incoming_edge, insert_initializers, introduce_cast_before_cand, replace_one_candidate): Likewise. * tree-ssa-math-opts.c (insert_reciprocals, powi_as_mults_1, powi_as_mults, build_and_insert_binop, build_and_insert_cast, pass_cse_sincos::execute, bswap_replace, convert_mult_to_fma): Likewise. * tree-tailcall.c (adjust_return_value_with_ops, update_accumulator_with_ops): Likewise. * tree-predcom.c (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, attempt_builtin_powi, reassociate_bb): Likewise. * tree-vect-loop.c (vect_is_simple_reduction_1, get_initial_def_for_induction, vect_create_epilog_for_reduction): Likewise. * ipa-split.c (split_function): Likewise. * tree-ssa-phiopt.c (conditional_replacement, minmax_replacement, abs_replacement, neg_replacement): Likewise. * tree-profile.c (gimple_gen_edge_profiler): Likewise. * tree-vrp.c (simplify_truth_ops_using_ranges, simplify_float_conversion_using_ranges, simplify_internal_call_using_ranges): Likewise. * gimple-fold.c (rewrite_to_defined_overflow, gimple_build): Likewise. * tree-vect-generic.c (expand_vector_divmod, optimize_vector_constructor): Likewise. * ubsan.c (ubsan_expand_null_ifn, ubsan_expand_objsize_ifn, instrument_bool_enum_load): Likewise. * tree-ssa-loop-manip.c (create_iv): Likewise. * omp-low.c (lower_rec_input_clauses, expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk, expand_cilk_for, simd_clone_adjust): Likewise. * trans-mem.c (expand_transaction): Likewise. * tree-vect-data-refs.c (bump_vector_ptr, vect_permute_store_chain, vect_setup_realignment, vect_permute_load_chain, vect_shift_permute_load_chain): Likewise. * tree-vect-stmts.c (vect_init_vector, vectorizable_mask_load_store, vectorizable_simd_clone_call, vect_gen_widened_results_half, vect_create_vectorized_demotion_stmts, vectorizable_conversion, vectorizable_shift, vectorizable_operation, vectorizable_store, permute_vec_elements, vectorizable_load): Likewise. From-SVN: r218216
2014-12-01 14:58:10 +01:00
gassign *cast_stmt = gimple_build_assign (lhs, NOP_EXPR, basis_name);
slsr_cand_t cc = c;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
gimple_set_location (cast_stmt, gimple_location (c->cand_stmt));
gsi_replace (&gsi, cast_stmt, false);
c->cand_stmt = cast_stmt;
while (cc->next_interp)
{
cc = lookup_cand (cc->next_interp);
cc->cand_stmt = cast_stmt;
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
if (dump_file && (dump_flags & TDF_DETAILS))
stmt_to_print = cast_stmt;
}
}
else
gcc_unreachable ();
if (dump_file && (dump_flags & TDF_DETAILS) && stmt_to_print)
{
fputs ("With: ", dump_file);
print_gimple_stmt (dump_file, stmt_to_print, 0, 0);
fputs ("\n", dump_file);
}
}
/* For each candidate in the tree rooted at C, replace it with
an increment if such has been shown to be profitable. */
static void
replace_profitable_candidates (slsr_cand_t c)
{
if (!cand_already_replaced (c))
{
2014-05-06 18:25:05 +02:00
widest_int increment = cand_abs_increment (c);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
enum tree_code orig_code = gimple_assign_rhs_code (c->cand_stmt);
int i;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
i = incr_vec_index (increment);
/* Only process profitable increments. Nothing useful can be done
to a cast or copy. */
if (i >= 0
&& profitable_increment_p (i)
&& orig_code != SSA_NAME
&& !CONVERT_EXPR_CODE_P (orig_code))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
{
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (phi_dependent_cand_p (c))
{
gphi *phi = as_a <gphi *> (lookup_cand (c->def_phi)->cand_stmt);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
if (all_phi_incrs_profitable (c, phi))
{
/* Look up the LHS SSA name from C's basis. This will be
the RHS1 of the adds we will introduce to create new
phi arguments. */
slsr_cand_t basis = lookup_cand (c->basis);
tree basis_name = gimple_assign_lhs (basis->cand_stmt);
/* Create a new phi statement that will represent C's true
basis after the transformation is complete. */
location_t loc = gimple_location (c->cand_stmt);
tree name = create_phi_basis (c, phi, basis_name,
loc, UNKNOWN_STRIDE);
/* Replace C with an add of the new basis phi and the
increment. */
replace_one_candidate (c, i, name);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
}
else
{
slsr_cand_t basis = lookup_cand (c->basis);
tree basis_name = gimple_assign_lhs (basis->cand_stmt);
replace_one_candidate (c, i, basis_name);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
}
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
}
}
if (c->sibling)
replace_profitable_candidates (lookup_cand (c->sibling));
if (c->dependent)
replace_profitable_candidates (lookup_cand (c->dependent));
}
/* Analyze costs of related candidates in the candidate vector,
and make beneficial replacements. */
static void
analyze_candidates_and_replace (void)
{
unsigned i;
slsr_cand_t c;
/* Each candidate that has a null basis and a non-null
dependent is the root of a tree of related statements.
Analyze each tree to determine a subset of those
statements that can be replaced with maximum benefit. */
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_ELT (cand_vec, i, c)
{
slsr_cand_t first_dep;
if (c->basis != 0 || c->dependent == 0)
continue;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nProcessing dependency tree rooted at %d.\n",
c->cand_num);
first_dep = lookup_cand (c->dependent);
/* If this is a chain of CAND_REFs, unconditionally replace
each of them with a strength-reduced data reference. */
if (c->kind == CAND_REF)
replace_refs (c);
gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. gcc: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (cand_kind): Add CAND_PHI. (slsr_cand_d): Redefine def_phi. (stride_status, phi_adjust_status, count_phis_status): New enums. (find_phi_def): New. (find_basis_for_base_expr): New. (find_basis_for_candidate): Handle hidden bases. (alloc_cand_and_find_basis): Handle phi candidates. (slsr_process_phi): New. (create_mul_ssa_cand): Exclude phi base candidates; use integer_onep. (create_mul_imm_cand): Likewise. (create_add_ssa_cand): Exclude phi base candidates. (create_add_imm_cand): Likewise. (slsr_process_cast): Likewise. (slsr_process_copy): Likewise. (find_candidates_in_block): Handle phi candidates. (dump_candidate): Likewise. (unconditional_cands): Delete. (unconditional_cands_with_known_stride_p): Delete. (phi_dependent_cand_p): New. (cand_increment): Handle phi-dependent candidates. (replace_dependent): Delete. (replace_mult_candidate): New. (replace_unconditional_candidate): New. (incr_vec_index): Move to avoid forward reference. (create_add_on_incoming_edge): New. (create_phi_basis): New. (replace_dependents): Delete. (replace_conditional_candidate): New. (phi_add_costs): New. (replace_uncond_cands_and_profitable_phis): New. (record_increment): Handle phi adjustments. (record_phi_increments): New. (record_increments): Handle phi adjustments. (phi_incr_cost): New. (lowest_cost_path): Handle phis. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_with_phi): New. (ncd_of_cand_and_phis): New. (nearest_common_dominator_for_cands): Handle phi increments. (all_phi_incrs_profitable): New. (replace_profitable_candidates): Handle phi-dependent candidates. (analyze_candidates_and_replace): Likewise. gcc/testsuite: 2013-05-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-32.c: New. * gcc.dg/tree-ssa/slsr-33.c: New. * gcc.dg/tree-ssa/slsr-34.c: New. * gcc.dg/tree-ssa/slsr-35.c: New. * gcc.dg/tree-ssa/slsr-36.c: New. * gcc.dg/tree-ssa/slsr-37.c: New. * gcc.dg/tree-ssa/slsr-38.c: New. From-SVN: r198586
2013-05-03 20:56:39 +02:00
/* If the common stride of all related candidates is a known
constant, each candidate without a phi-dependence can be
profitably replaced. Each replaces a multiply by a single
add, with the possibility that a feeding add also goes dead.
A candidate with a phi-dependence is replaced only if the
compensation code it requires is offset by the strength
reduction savings. */
else if (TREE_CODE (c->stride) == INTEGER_CST)
replace_uncond_cands_and_profitable_phis (first_dep);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* When the stride is an SSA name, it may still be profitable
to replace some or all of the dependent candidates, depending
on whether the introduced increments can be reused, or are
less expensive to calculate than the replaced statements. */
else
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode;
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
bool speed;
/* Determine whether we'll be generating pointer arithmetic
when replacing candidates. */
address_arithmetic_p = (c->kind == CAND_ADD
&& POINTER_TYPE_P (c->cand_type));
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
/* If all candidates have already been replaced under other
interpretations, nothing remains to be done. */
if (!count_candidates (c))
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
continue;
/* Construct an array of increments for this candidate chain. */
incr_vec = XNEWVEC (incr_info, MAX_INCR_VEC_LEN);
gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. gcc: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gimple-ssa-strength-reduction.c (struct incr_info_d): New struct. (incr_vec): New static var. (incr_vec_len): Likewise. (address_arithmetic_p): Likewise. (stmt_cost): Remove dead assignment. (dump_incr_vec): New function. (cand_abs_increment): Likewise. (lazy_create_slsr_reg): Likewise. (incr_vec_index): Likewise. (count_candidates): Likewise. (record_increment): Likewise. (record_increments): Likewise. (unreplaced_cand_in_tree): Likewise. (optimize_cands_for_speed_p): Likewise. (lowest_cost_path): Likewise. (total_savings): Likewise. (analyze_increments): Likewise. (ncd_for_two_cands): Likewise. (nearest_common_dominator_for_cands): Likewise. (profitable_increment_p): Likewise. (insert_initializers): Likewise. (introduce_cast_before_cand): Likewise. (replace_rhs_if_not_dup): Likewise. (replace_one_candidate): Likewise. (replace_profitable_candidates): Likewise. (analyze_candidates_and_replace): Handle candidates with SSA-name strides. gcc/testsuite: 2012-08-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.dg/tree-ssa/slsr-5.c: New. * gcc.dg/tree-ssa/slsr-6.c: New. * gcc.dg/tree-ssa/slsr-7.c: New. * gcc.dg/tree-ssa/slsr-8.c: New. * gcc.dg/tree-ssa/slsr-9.c: New. * gcc.dg/tree-ssa/slsr-10.c: New. * gcc.dg/tree-ssa/slsr-11.c: New. * gcc.dg/tree-ssa/slsr-12.c: New. * gcc.dg/tree-ssa/slsr-13.c: New. * gcc.dg/tree-ssa/slsr-14.c: New. * gcc.dg/tree-ssa/slsr-15.c: New. * gcc.dg/tree-ssa/slsr-16.c: New. * gcc.dg/tree-ssa/slsr-17.c: New. * gcc.dg/tree-ssa/slsr-18.c: New. * gcc.dg/tree-ssa/slsr-19.c: New. * gcc.dg/tree-ssa/slsr-20.c: New. * gcc.dg/tree-ssa/slsr-21.c: New. * gcc.dg/tree-ssa/slsr-22.c: New. * gcc.dg/tree-ssa/slsr-23.c: New. * gcc.dg/tree-ssa/slsr-24.c: New. * gcc.dg/tree-ssa/slsr-25.c: New. * gcc.dg/tree-ssa/slsr-26.c: New. * gcc.dg/tree-ssa/slsr-30.c: New. * gcc.dg/tree-ssa/slsr-31.c: New. From-SVN: r190220
2012-08-08 03:35:22 +02:00
incr_vec_len = 0;
record_increments (c);
/* Determine which increments are profitable to replace. */
mode = TYPE_MODE (TREE_TYPE (gimple_assign_lhs (c->cand_stmt)));
speed = optimize_cands_for_speed_p (c);
analyze_increments (first_dep, mode, speed);
/* Insert initializers of the form T_0 = stride * increment
for use in profitable replacements. */
insert_initializers (first_dep);
dump_incr_vec ();
/* Perform the replacements. */
replace_profitable_candidates (first_dep);
free (incr_vec);
}
}
/* For conditional candidates, we may have uncommitted insertions
on edges to clean up. */
gsi_commit_edge_inserts ();
}
namespace {
const pass_data pass_data_strength_reduction =
pass cfun to pass::execute gcc/ * passes.c (opt_pass::execute): Adjust. (pass_manager::execute_pass_mode_switching): Likewise. (early_local_passes::execute): Likewise. (execute_one_pass): Pass cfun to the pass's execute method. * tree-pass.h (opt_pass::execute): Add function * argument. * asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c, cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c, compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c, config/epiphany/resolve-sw-modes.c, config/i386/i386.c, config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c, config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c, except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c, gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c, graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c, lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c, postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c, store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c, tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c, tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c: Adjust. From-SVN: r209482
2014-04-17 14:37:34 +02:00
{
GIMPLE_PASS, /* type */
"slsr", /* name */
OPTGROUP_NONE, /* optinfo_flags */
TV_GIMPLE_SLSR, /* tv_id */
( PROP_cfg | PROP_ssa ), /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
tree-pass.h (TODO_verify_ssa, [...]): Remove. 2014-05-06 Richard Biener <rguenther@suse.de> * tree-pass.h (TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts, TODO_verify_rtl_sharing): Remove. (TODO_verify_all): Adjust. * asan.c: Remove references to TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts and TODO_verify_rtl_sharing. * bb-reorder.c: Likewise. * cfgexpand.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * ipa-split.c: Likewise. * loop-init.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * modulo-sched.c: Likewise. * postreload-gcse.c: Likewise. * predict.c: Likewise. * recog.c: Likewise. * sched-rgn.c: Likewise. * store-motion.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-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-object-size.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.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-loop-ch.c: Likewise. * tree-ssa-loop-ivcanon.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-reassoc.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * var-tracking.c: Likewise. * bt-load.c: Likewise. * cfgcleanup.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/i386/i386.c: Likewise. * config/mips/mips.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sparc/sparc.c: Likewise. * dce.c: Likewise. * dse.c: Likewise. * final.c: Likewise. * ifcvt.c: Likewise. * mode-switching.c: Likewise. * passes.c: Likewise. * postreload.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * regrename.c: Likewise. * web.c: Likewise. From-SVN: r210106
2014-05-06 15:35:40 +02:00
0, /* todo_flags_finish */
pass cfun to pass::execute gcc/ * passes.c (opt_pass::execute): Adjust. (pass_manager::execute_pass_mode_switching): Likewise. (early_local_passes::execute): Likewise. (execute_one_pass): Pass cfun to the pass's execute method. * tree-pass.h (opt_pass::execute): Add function * argument. * asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c, cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c, compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c, config/epiphany/resolve-sw-modes.c, config/i386/i386.c, config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c, config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c, except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c, gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c, graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c, lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c, postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c, store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c, tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c, tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c: Adjust. From-SVN: r209482
2014-04-17 14:37:34 +02:00
};
class pass_strength_reduction : public gimple_opt_pass
pass cfun to pass::execute gcc/ * passes.c (opt_pass::execute): Adjust. (pass_manager::execute_pass_mode_switching): Likewise. (early_local_passes::execute): Likewise. (execute_one_pass): Pass cfun to the pass's execute method. * tree-pass.h (opt_pass::execute): Add function * argument. * asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c, cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c, compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c, config/epiphany/resolve-sw-modes.c, config/i386/i386.c, config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c, config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c, except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c, gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c, graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c, lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c, postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c, store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c, tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c, tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c: Adjust. From-SVN: r209482
2014-04-17 14:37:34 +02:00
{
public:
pass_strength_reduction (gcc::context *ctxt)
: gimple_opt_pass (pass_data_strength_reduction, ctxt)
{}
/* opt_pass methods: */
virtual bool gate (function *) { return flag_tree_slsr; }
virtual unsigned int execute (function *);
}; // class pass_strength_reduction
unsigned
pass_strength_reduction::execute (function *fun)
{
/* Create the obstack where candidates will reside. */
gcc_obstack_init (&cand_obstack);
/* Allocate the candidate vector. */
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
cand_vec.create (128);
/* Allocate the mapping from statements to candidate indices. */
stmt_cand_map = new hash_map<gimple *, slsr_cand_t>;
/* Create the obstack where candidate chains will reside. */
gcc_obstack_init (&chain_obstack);
/* Allocate the mapping from base expressions to candidate chains. */
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
base_cand_map = new hash_table<cand_chain_hasher> (500);
/* Allocate the mapping from bases to alternative bases. */
alt_base_map = new hash_map<tree, tree>;
/* Initialize the loop optimizer. We need to detect flow across
back edges, and this gives us dominator information as well. */
loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
/* Walk the CFG in predominator order looking for strength reduction
candidates. */
compare-elim.c (find_comparison_dom_walker): New class * compare-elim.c (find_comparison_dom_walker): New class (find_comparisons_in_bb): Rename to find_comparison_dom_walker::before_dom_children (find_comparisons): Adjust * domwalk.c (walk_dominator_tree): Rename to dom_walker::walk, and adjust. (init_walk_dominator_tree, fini_walk_dominator_tree): Remove * domwalk.h (dom_walk_data): Convert it To a class dom_walker. (init_walk_dominator_tree): Remove declaration. (fini_walk_dominator_tree): Remove declaration. * fwprop.c (single_def_use_dom_walker): New class (single_def_use_enter_block): Convert to single_def_use_dom_walker::before_dom_children. (single_def_use_leave_block): Convert to single_def_use_dom_walker::after_dom_children. (build_single_def_use_links): Adjust. * gimple-ssa-strength-reduction.c (find_candidates_dom_walker): New class. (find_candidates_in_block): Convert to find_candidates_dom_walker::before_dom_children. (execute_strength_reduction): Adjust. * graphite-sese-to-poly.c (struct bsc, build_sese_conditions): Remove. (sese_dom_walker): New class. (sese_dom_walker::sese_dom_walker): New constructor. (sese_dom_walker::~sese_dom_walker): New destructor. (build_sese_conditions_before): Convert to sese_dom_walker::before_dom_children. (build_sese_conditions_after): Convert to sese_dom_walker::after_dom_children. (build_poly_scop): Adjust * tree-into-ssa.c (rewrite_dom_walker): New class (rewrite_enter_block): Convert to rewrite_dom_walker::before_dom_children. (rewrite_leave_block): Convert to rewrite_dom_walker::after_dom_children. (rewrite_update_dom_walker): New class. (rewrite_update_enter_block): Convert to rewrite_update_dom_walker::before_dom_children. (rewrite_update_leave_block): Convert to rewrite_update_dom_walker::after_dom_children. (rewrite_blocks, rewrite_into_ssa): Adjust. (mark_def_dom_walker): New class. (mark_def_dom_walker::mark_def_dom_walker): New constructor. (mark_def_dom_walker::~mark_def_dom_walker): New destructor. (mark_def_sites_blocks): Convert to mark_def_dom_walker::before_dom_children. (mark_def_site_blocks): Remove. * tree-ssa-dom.c (dom_opt_dom_walker): New class. (tree_ssa_dominator_optimize): Adjust. (dom_thread_across_edge): Convert to method dom_opt_dom_walker::thread_across_edge. (dom_opt_enter_block): Convert to member function dom_opt_dom_walker::before_dom_children. (dom_opt_leave_block): Convert to member function dom_opt_dom_walker::after_dom_children. * tree-ssa-dse.c (dse_dom_walker): New class. (dse_enter_block): Convert to member function dse_dom_walker::before_dom_children. (tree_ssa_dse): Adjust. * tree-ssa-loop-im.c (invariantness_dom_walker): New class. (determine_invariantness_stmt): Convert to method invariantness_dom_walker::before_dom_children. (determine_invariantness): Remove (move_computations_dom_walker): New class. (move_computations_stmt): Convert to method move_computations_dom_walker::before_dom_children. (move_computations, tree_ssa_lim): Adjust. * tree-ssa-phiopt.c (nontrapping_dom_walker): new class (nt_init_block): Make method notrappping_dom_walker::before_dom_children. (nt_fini_block): Make method nontrapping_dom_walker::after_dom_children. (get_non_trapping): Adjust. * tree-ssa-pre.c (eliminate_dom_walker): New class. (eliminate_bb): Make method eliminate_dom_walker::before_dom_children. (eliminate_leave_block): Make method. eliminate_dom_walker::after_dom_children. (eliminate): Adjust * tree-ssa-strlen.c (strlen_dom_walker): New class. (strlen_enter_block): Make method strlen_dom_walker::before_dom_children. (strlen_leave_block): Make method strlen_dom_walker::after_dom_children. (tree_ssa_strlen): Adjust. * tree-ssa-uncprop.c (uncprop_dom_walker): New class. (tree_ssa_uncprop): Adjust. (uncprop_leave_block): Make method uncprop_dom_walker::after_dom_children. (uncprop_leave_block): Make method uncprop_dom_walker::before_dom_children. From-SVN: r202679
2013-09-18 04:39:50 +02:00
find_candidates_dom_walker (CDI_DOMINATORS)
pass cfun to pass::execute gcc/ * passes.c (opt_pass::execute): Adjust. (pass_manager::execute_pass_mode_switching): Likewise. (early_local_passes::execute): Likewise. (execute_one_pass): Pass cfun to the pass's execute method. * tree-pass.h (opt_pass::execute): Add function * argument. * asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c, cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c, compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c, config/epiphany/resolve-sw-modes.c, config/i386/i386.c, config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c, config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c, except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c, gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c, graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c, lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c, postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c, store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c, tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c, tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c: Adjust. From-SVN: r209482
2014-04-17 14:37:34 +02:00
.walk (fun->cfg->x_entry_block_ptr);
if (dump_file && (dump_flags & TDF_DETAILS))
{
dump_cand_vec ();
dump_cand_chains ();
}
delete alt_base_map;
free_affine_expand_cache (&name_expansions);
/* Analyze costs and make appropriate replacements. */
analyze_candidates_and_replace ();
loop_optimizer_finalize ();
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
delete base_cand_map;
base_cand_map = NULL;
obstack_free (&chain_obstack, NULL);
delete stmt_cand_map;
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
cand_vec.release ();
obstack_free (&cand_obstack, NULL);
return 0;
}
} // anon namespace
Automated conversion of passes to C++ classes gcc/ Patch autogenerated by refactor_passes.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 03fe39476a4c4ea450b49e087cfa817b5f92021e * asan.c (pass_asan): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_asan): ...new pass_data instance and... (make_pass_asan): ...new function. (pass_asan_O0): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_asan_O0): ...new pass_data instance and... (make_pass_asan_O0): ...new function. * auto-inc-dec.c (pass_inc_dec): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_inc_dec): ...new pass_data instance and... (make_pass_inc_dec): ...new function. * bb-reorder.c (pass_reorder_blocks): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_reorder_blocks): ...new pass_data instance and... (make_pass_reorder_blocks): ...new function. (pass_duplicate_computed_gotos): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_duplicate_computed_gotos): ...new pass_data instance and... (make_pass_duplicate_computed_gotos): ...new function. (pass_partition_blocks): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_partition_blocks): ...new pass_data instance and... (make_pass_partition_blocks): ...new function. * bt-load.c (pass_branch_target_load_optimize1): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_branch_target_load_optimize1): ...new pass_data instance and... (make_pass_branch_target_load_optimize1): ...new function. (pass_branch_target_load_optimize2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_branch_target_load_optimize2): ...new pass_data instance and... (make_pass_branch_target_load_optimize2): ...new function. * cfgcleanup.c (pass_jump): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_jump): ...new pass_data instance and... (make_pass_jump): ...new function. (pass_jump2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_jump2): ...new pass_data instance and... (make_pass_jump2): ...new function. * cfgexpand.c (pass_expand): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_expand): ...new pass_data instance and... (make_pass_expand): ...new function. * cfgrtl.c (pass_free_cfg): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_free_cfg): ...new pass_data instance and... (make_pass_free_cfg): ...new function. (pass_into_cfg_layout_mode): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_into_cfg_layout_mode): ...new pass_data instance and... (make_pass_into_cfg_layout_mode): ...new function. (pass_outof_cfg_layout_mode): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_outof_cfg_layout_mode): ...new pass_data instance and... (make_pass_outof_cfg_layout_mode): ...new function. * cgraphbuild.c (pass_build_cgraph_edges): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_build_cgraph_edges): ...new pass_data instance and... (make_pass_build_cgraph_edges): ...new function. (pass_rebuild_cgraph_edges): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_rebuild_cgraph_edges): ...new pass_data instance and... (make_pass_rebuild_cgraph_edges): ...new function. (pass_remove_cgraph_callee_edges): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_remove_cgraph_callee_edges): ...new pass_data instance and... (make_pass_remove_cgraph_callee_edges): ...new function. * combine-stack-adj.c (pass_stack_adjustments): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_stack_adjustments): ...new pass_data instance and... (make_pass_stack_adjustments): ...new function. * combine.c (pass_combine): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_combine): ...new pass_data instance and... (make_pass_combine): ...new function. * compare-elim.c (pass_compare_elim_after_reload): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_compare_elim_after_reload): ...new pass_data instance and... (make_pass_compare_elim_after_reload): ...new function. * cprop.c (pass_rtl_cprop): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_cprop): ...new pass_data instance and... (make_pass_rtl_cprop): ...new function. * cse.c (pass_cse): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_cse): ...new pass_data instance and... (make_pass_cse): ...new function. (pass_cse2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_cse2): ...new pass_data instance and... (make_pass_cse2): ...new function. (pass_cse_after_global_opts): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_cse_after_global_opts): ...new pass_data instance and... (make_pass_cse_after_global_opts): ...new function. * dce.c (pass_ud_rtl_dce): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_ud_rtl_dce): ...new pass_data instance and... (make_pass_ud_rtl_dce): ...new function. (pass_fast_rtl_dce): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_fast_rtl_dce): ...new pass_data instance and... (make_pass_fast_rtl_dce): ...new function. * df-core.c (pass_df_initialize_opt): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_df_initialize_opt): ...new pass_data instance and... (make_pass_df_initialize_opt): ...new function. (pass_df_initialize_no_opt): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_df_initialize_no_opt): ...new pass_data instance and... (make_pass_df_initialize_no_opt): ...new function. (pass_df_finish): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_df_finish): ...new pass_data instance and... (make_pass_df_finish): ...new function. * dse.c (pass_rtl_dse1): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_dse1): ...new pass_data instance and... (make_pass_rtl_dse1): ...new function. (pass_rtl_dse2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_dse2): ...new pass_data instance and... (make_pass_rtl_dse2): ...new function. * dwarf2cfi.c (pass_dwarf2_frame): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_dwarf2_frame): ...new pass_data instance and... (make_pass_dwarf2_frame): ...new function. * except.c (pass_set_nothrow_function_flags): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_set_nothrow_function_flags): ...new pass_data instance and... (make_pass_set_nothrow_function_flags): ...new function. (pass_convert_to_eh_region_ranges): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_convert_to_eh_region_ranges): ...new pass_data instance and... (make_pass_convert_to_eh_region_ranges): ...new function. * final.c (pass_compute_alignments): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_compute_alignments): ...new pass_data instance and... (make_pass_compute_alignments): ...new function. (pass_final): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_final): ...new pass_data instance and... (make_pass_final): ...new function. (pass_shorten_branches): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_shorten_branches): ...new pass_data instance and... (make_pass_shorten_branches): ...new function. (pass_clean_state): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_clean_state): ...new pass_data instance and... (make_pass_clean_state): ...new function. * function.c (pass_instantiate_virtual_regs): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_instantiate_virtual_regs): ...new pass_data instance and... (make_pass_instantiate_virtual_regs): ...new function. (pass_leaf_regs): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_leaf_regs): ...new pass_data instance and... (make_pass_leaf_regs): ...new function. (pass_thread_prologue_and_epilogue): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_thread_prologue_and_epilogue): ...new pass_data instance and... (make_pass_thread_prologue_and_epilogue): ...new function. (pass_match_asm_constraints): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_match_asm_constraints): ...new pass_data instance and... (make_pass_match_asm_constraints): ...new function. * fwprop.c (pass_rtl_fwprop): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_fwprop): ...new pass_data instance and... (make_pass_rtl_fwprop): ...new function. (pass_rtl_fwprop_addr): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_fwprop_addr): ...new pass_data instance and... (make_pass_rtl_fwprop_addr): ...new function. * gcse.c (pass_rtl_pre): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_pre): ...new pass_data instance and... (make_pass_rtl_pre): ...new function. (pass_rtl_hoist): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_hoist): ...new pass_data instance and... (make_pass_rtl_hoist): ...new function. * gimple-low.c (pass_lower_cf): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_cf): ...new pass_data instance and... (make_pass_lower_cf): ...new function. * gimple-ssa-strength-reduction.c (pass_strength_reduction): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_strength_reduction): ...new pass_data instance and... (make_pass_strength_reduction): ...new function. * ifcvt.c (pass_rtl_ifcvt): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_ifcvt): ...new pass_data instance and... (make_pass_rtl_ifcvt): ...new function. (pass_if_after_combine): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_if_after_combine): ...new pass_data instance and... (make_pass_if_after_combine): ...new function. (pass_if_after_reload): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_if_after_reload): ...new pass_data instance and... (make_pass_if_after_reload): ...new function. * init-regs.c (pass_initialize_regs): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_initialize_regs): ...new pass_data instance and... (make_pass_initialize_regs): ...new function. * ipa-cp.c (pass_ipa_cp): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_cp): ...new pass_data instance and... (make_pass_ipa_cp): ...new function. * ipa-inline-analysis.c (pass_inline_parameters): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_inline_parameters): ...new pass_data instance and... (make_pass_inline_parameters): ...new function. * ipa-inline.c (pass_early_inline): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_early_inline): ...new pass_data instance and... (make_pass_early_inline): ...new function. (pass_ipa_inline): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_inline): ...new pass_data instance and... (make_pass_ipa_inline): ...new function. * ipa-pure-const.c (pass_local_pure_const): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_local_pure_const): ...new pass_data instance and... (make_pass_local_pure_const): ...new function. (pass_ipa_pure_const): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_pure_const): ...new pass_data instance and... (make_pass_ipa_pure_const): ...new function. * ipa-reference.c (pass_ipa_reference): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_reference): ...new pass_data instance and... (make_pass_ipa_reference): ...new function. * ipa-split.c (pass_split_functions): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_split_functions): ...new pass_data instance and... (make_pass_split_functions): ...new function. (pass_feedback_split_functions): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_feedback_split_functions): ...new pass_data instance and... (make_pass_feedback_split_functions): ...new function. * ipa.c (pass_ipa_function_and_variable_visibility): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_function_and_variable_visibility): ...new pass_data instance and... (make_pass_ipa_function_and_variable_visibility): ...new function. (pass_ipa_free_inline_summary): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_free_inline_summary): ...new pass_data instance and... (make_pass_ipa_free_inline_summary): ...new function. (pass_ipa_whole_program_visibility): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_whole_program_visibility): ...new pass_data instance and... (make_pass_ipa_whole_program_visibility): ...new function. (pass_ipa_profile): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_profile): ...new pass_data instance and... (make_pass_ipa_profile): ...new function. (pass_ipa_cdtor_merge): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_cdtor_merge): ...new pass_data instance and... (make_pass_ipa_cdtor_merge): ...new function. * ira.c (pass_ira): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_ira): ...new pass_data instance and... (make_pass_ira): ...new function. (pass_reload): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_reload): ...new pass_data instance and... (make_pass_reload): ...new function. * jump.c (pass_cleanup_barriers): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_cleanup_barriers): ...new pass_data instance and... (make_pass_cleanup_barriers): ...new function. * loop-init.c (pass_loop2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_loop2): ...new pass_data instance and... (make_pass_loop2): ...new function. (pass_rtl_loop_init): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_loop_init): ...new pass_data instance and... (make_pass_rtl_loop_init): ...new function. (pass_rtl_loop_done): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_loop_done): ...new pass_data instance and... (make_pass_rtl_loop_done): ...new function. (pass_rtl_move_loop_invariants): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_move_loop_invariants): ...new pass_data instance and... (make_pass_rtl_move_loop_invariants): ...new function. (pass_rtl_unswitch): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_unswitch): ...new pass_data instance and... (make_pass_rtl_unswitch): ...new function. (pass_rtl_unroll_and_peel_loops): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_unroll_and_peel_loops): ...new pass_data instance and... (make_pass_rtl_unroll_and_peel_loops): ...new function. (pass_rtl_doloop): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_doloop): ...new pass_data instance and... (make_pass_rtl_doloop): ...new function. * lower-subreg.c (pass_lower_subreg): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_lower_subreg): ...new pass_data instance and... (make_pass_lower_subreg): ...new function. (pass_lower_subreg2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_lower_subreg2): ...new pass_data instance and... (make_pass_lower_subreg2): ...new function. * lto-streamer-out.c (pass_ipa_lto_gimple_out): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_lto_gimple_out): ...new pass_data instance and... (make_pass_ipa_lto_gimple_out): ...new function. (pass_ipa_lto_finish_out): Convert from a global struct to a subclass of ipa_opt_pass_d along with... (pass_data_ipa_lto_finish_out): ...new pass_data instance and... (make_pass_ipa_lto_finish_out): ...new function. * mode-switching.c (pass_mode_switching): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_mode_switching): ...new pass_data instance and... (make_pass_mode_switching): ...new function. * modulo-sched.c (pass_sms): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_sms): ...new pass_data instance and... (make_pass_sms): ...new function. * omp-low.c (pass_expand_omp): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_expand_omp): ...new pass_data instance and... (make_pass_expand_omp): ...new function. (pass_lower_omp): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_omp): ...new pass_data instance and... (make_pass_lower_omp): ...new function. (pass_diagnose_omp_blocks): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_diagnose_omp_blocks): ...new pass_data instance and... (make_pass_diagnose_omp_blocks): ...new function. * passes.c (pass_early_local_passes): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_early_local_passes): ...new pass_data instance and... (make_pass_early_local_passes): ...new function. (pass_all_early_optimizations): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_all_early_optimizations): ...new pass_data instance and... (make_pass_all_early_optimizations): ...new function. (pass_all_optimizations): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_all_optimizations): ...new pass_data instance and... (make_pass_all_optimizations): ...new function. (pass_all_optimizations_g): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_all_optimizations_g): ...new pass_data instance and... (make_pass_all_optimizations_g): ...new function. (pass_rest_of_compilation): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rest_of_compilation): ...new pass_data instance and... (make_pass_rest_of_compilation): ...new function. (pass_postreload): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_postreload): ...new pass_data instance and... (make_pass_postreload): ...new function. * postreload-gcse.c (pass_gcse2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_gcse2): ...new pass_data instance and... (make_pass_gcse2): ...new function. * postreload.c (pass_postreload_cse): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_postreload_cse): ...new pass_data instance and... (make_pass_postreload_cse): ...new function. * predict.c (pass_profile): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_profile): ...new pass_data instance and... (make_pass_profile): ...new function. (pass_strip_predict_hints): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_strip_predict_hints): ...new pass_data instance and... (make_pass_strip_predict_hints): ...new function. * recog.c (pass_peephole2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_peephole2): ...new pass_data instance and... (make_pass_peephole2): ...new function. (pass_split_all_insns): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_split_all_insns): ...new pass_data instance and... (make_pass_split_all_insns): ...new function. (pass_split_after_reload): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_split_after_reload): ...new pass_data instance and... (make_pass_split_after_reload): ...new function. (pass_split_before_regstack): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_split_before_regstack): ...new pass_data instance and... (make_pass_split_before_regstack): ...new function. (pass_split_before_sched2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_split_before_sched2): ...new pass_data instance and... (make_pass_split_before_sched2): ...new function. (pass_split_for_shorten_branches): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_split_for_shorten_branches): ...new pass_data instance and... (make_pass_split_for_shorten_branches): ...new function. * ree.c (pass_ree): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_ree): ...new pass_data instance and... (make_pass_ree): ...new function. * reg-stack.c (pass_stack_regs): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_stack_regs): ...new pass_data instance and... (make_pass_stack_regs): ...new function. (pass_stack_regs_run): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_stack_regs_run): ...new pass_data instance and... (make_pass_stack_regs_run): ...new function. * regcprop.c (pass_cprop_hardreg): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_cprop_hardreg): ...new pass_data instance and... (make_pass_cprop_hardreg): ...new function. * reginfo.c (pass_reginfo_init): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_reginfo_init): ...new pass_data instance and... (make_pass_reginfo_init): ...new function. * regmove.c (pass_regmove): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_regmove): ...new pass_data instance and... (make_pass_regmove): ...new function. * regrename.c (pass_regrename): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_regrename): ...new pass_data instance and... (make_pass_regrename): ...new function. * reorg.c (pass_delay_slots): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_delay_slots): ...new pass_data instance and... (make_pass_delay_slots): ...new function. (pass_machine_reorg): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_machine_reorg): ...new pass_data instance and... (make_pass_machine_reorg): ...new function. * sched-rgn.c (pass_sched): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_sched): ...new pass_data instance and... (make_pass_sched): ...new function. (pass_sched2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_sched2): ...new pass_data instance and... (make_pass_sched2): ...new function. * stack-ptr-mod.c (pass_stack_ptr_mod): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_stack_ptr_mod): ...new pass_data instance and... (make_pass_stack_ptr_mod): ...new function. * store-motion.c (pass_rtl_store_motion): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_rtl_store_motion): ...new pass_data instance and... (make_pass_rtl_store_motion): ...new function. * tracer.c (pass_tracer): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tracer): ...new pass_data instance and... (make_pass_tracer): ...new function. * trans-mem.c (pass_diagnose_tm_blocks): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_diagnose_tm_blocks): ...new pass_data instance and... (make_pass_diagnose_tm_blocks): ...new function. (pass_lower_tm): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_tm): ...new pass_data instance and... (make_pass_lower_tm): ...new function. (pass_tm_init): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tm_init): ...new pass_data instance and... (make_pass_tm_init): ...new function. (pass_tm_mark): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tm_mark): ...new pass_data instance and... (make_pass_tm_mark): ...new function. (pass_tm_edges): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tm_edges): ...new pass_data instance and... (make_pass_tm_edges): ...new function. (pass_tm_memopt): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tm_memopt): ...new pass_data instance and... (make_pass_tm_memopt): ...new function. (pass_ipa_tm): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_tm): ...new pass_data instance and... (make_pass_ipa_tm): ...new function. * tree-call-cdce.c (pass_call_cdce): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_call_cdce): ...new pass_data instance and... (make_pass_call_cdce): ...new function. * tree-cfg.c (pass_build_cfg): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_build_cfg): ...new pass_data instance and... (make_pass_build_cfg): ...new function. (pass_split_crit_edges): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_split_crit_edges): ...new pass_data instance and... (make_pass_split_crit_edges): ...new function. (pass_warn_function_return): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_warn_function_return): ...new pass_data instance and... (make_pass_warn_function_return): ...new function. (pass_warn_function_noreturn): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_warn_function_noreturn): ...new pass_data instance and... (make_pass_warn_function_noreturn): ...new function. (pass_warn_unused_result): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_warn_unused_result): ...new pass_data instance and... (make_pass_warn_unused_result): ...new function. * tree-cfgcleanup.c (pass_merge_phi): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_merge_phi): ...new pass_data instance and... (make_pass_merge_phi): ...new function. * tree-complex.c (pass_lower_complex): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_complex): ...new pass_data instance and... (make_pass_lower_complex): ...new function. (pass_lower_complex_O0): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_complex_O0): ...new pass_data instance and... (make_pass_lower_complex_O0): ...new function. * tree-eh.c (pass_lower_eh): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_eh): ...new pass_data instance and... (make_pass_lower_eh): ...new function. (pass_refactor_eh): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_refactor_eh): ...new pass_data instance and... (make_pass_refactor_eh): ...new function. (pass_lower_resx): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_resx): ...new pass_data instance and... (make_pass_lower_resx): ...new function. (pass_lower_eh_dispatch): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_eh_dispatch): ...new pass_data instance and... (make_pass_lower_eh_dispatch): ...new function. (pass_cleanup_eh): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_cleanup_eh): ...new pass_data instance and... (make_pass_cleanup_eh): ...new function. * tree-emutls.c (pass_ipa_lower_emutls): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_lower_emutls): ...new pass_data instance and... (make_pass_ipa_lower_emutls): ...new function. * tree-if-conv.c (pass_if_conversion): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_if_conversion): ...new pass_data instance and... (make_pass_if_conversion): ...new function. * tree-into-ssa.c (pass_build_ssa): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_build_ssa): ...new pass_data instance and... (make_pass_build_ssa): ...new function. * tree-loop-distribution.c (pass_loop_distribution): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_loop_distribution): ...new pass_data instance and... (make_pass_loop_distribution): ...new function. * tree-mudflap.c (pass_mudflap_1): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_mudflap_1): ...new pass_data instance and... (make_pass_mudflap_1): ...new function. (pass_mudflap_2): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_mudflap_2): ...new pass_data instance and... (make_pass_mudflap_2): ...new function. * tree-nomudflap.c (pass_mudflap_1): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_mudflap_1): ...new pass_data instance and... (make_pass_mudflap_1): ...new function. (pass_mudflap_2): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_mudflap_2): ...new pass_data instance and... (make_pass_mudflap_2): ...new function. * tree-nrv.c (pass_nrv): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_nrv): ...new pass_data instance and... (make_pass_nrv): ...new function. (pass_return_slot): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_return_slot): ...new pass_data instance and... (make_pass_return_slot): ...new function. * tree-object-size.c (pass_object_sizes): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_object_sizes): ...new pass_data instance and... (make_pass_object_sizes): ...new function. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_cleanup_cfg_post_optimizing): ...new pass_data instance and... (make_pass_cleanup_cfg_post_optimizing): ...new function. (pass_fixup_cfg): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_fixup_cfg): ...new pass_data instance and... (make_pass_fixup_cfg): ...new function. * tree-pass.h (pass_mudflap_1): Replace declaration with that of... (make_pass_mudflap_1): ...new function. (pass_mudflap_2): Replace declaration with that of... (make_pass_mudflap_2): ...new function. (pass_asan): Replace declaration with that of... (make_pass_asan): ...new function. (pass_asan_O0): Replace declaration with that of... (make_pass_asan_O0): ...new function. (pass_tsan): Replace declaration with that of... (make_pass_tsan): ...new function. (pass_tsan_O0): Replace declaration with that of... (make_pass_tsan_O0): ...new function. (pass_lower_cf): Replace declaration with that of... (make_pass_lower_cf): ...new function. (pass_refactor_eh): Replace declaration with that of... (make_pass_refactor_eh): ...new function. (pass_lower_eh): Replace declaration with that of... (make_pass_lower_eh): ...new function. (pass_lower_eh_dispatch): Replace declaration with that of... (make_pass_lower_eh_dispatch): ...new function. (pass_lower_resx): Replace declaration with that of... (make_pass_lower_resx): ...new function. (pass_build_cfg): Replace declaration with that of... (make_pass_build_cfg): ...new function. (pass_early_tree_profile): Replace declaration with that of... (make_pass_early_tree_profile): ...new function. (pass_cleanup_eh): Replace declaration with that of... (make_pass_cleanup_eh): ...new function. (pass_sra): Replace declaration with that of... (make_pass_sra): ...new function. (pass_sra_early): Replace declaration with that of... (make_pass_sra_early): ...new function. (pass_early_ipa_sra): Replace declaration with that of... (make_pass_early_ipa_sra): ...new function. (pass_tail_recursion): Replace declaration with that of... (make_pass_tail_recursion): ...new function. (pass_tail_calls): Replace declaration with that of... (make_pass_tail_calls): ...new function. (pass_tree_loop): Replace declaration with that of... (make_pass_tree_loop): ...new function. (pass_tree_loop_init): Replace declaration with that of... (make_pass_tree_loop_init): ...new function. (pass_lim): Replace declaration with that of... (make_pass_lim): ...new function. (pass_tree_unswitch): Replace declaration with that of... (make_pass_tree_unswitch): ...new function. (pass_predcom): Replace declaration with that of... (make_pass_predcom): ...new function. (pass_iv_canon): Replace declaration with that of... (make_pass_iv_canon): ...new function. (pass_scev_cprop): Replace declaration with that of... (make_pass_scev_cprop): ...new function. (pass_empty_loop): Replace declaration with that of... (make_pass_empty_loop): ...new function. (pass_record_bounds): Replace declaration with that of... (make_pass_record_bounds): ...new function. (pass_graphite): Replace declaration with that of... (make_pass_graphite): ...new function. (pass_graphite_transforms): Replace declaration with that of... (make_pass_graphite_transforms): ...new function. (pass_if_conversion): Replace declaration with that of... (make_pass_if_conversion): ...new function. (pass_loop_distribution): Replace declaration with that of... (make_pass_loop_distribution): ...new function. (pass_vectorize): Replace declaration with that of... (make_pass_vectorize): ...new function. (pass_slp_vectorize): Replace declaration with that of... (make_pass_slp_vectorize): ...new function. (pass_complete_unroll): Replace declaration with that of... (make_pass_complete_unroll): ...new function. (pass_complete_unrolli): Replace declaration with that of... (make_pass_complete_unrolli): ...new function. (pass_parallelize_loops): Replace declaration with that of... (make_pass_parallelize_loops): ...new function. (pass_loop_prefetch): Replace declaration with that of... (make_pass_loop_prefetch): ...new function. (pass_iv_optimize): Replace declaration with that of... (make_pass_iv_optimize): ...new function. (pass_tree_loop_done): Replace declaration with that of... (make_pass_tree_loop_done): ...new function. (pass_ch): Replace declaration with that of... (make_pass_ch): ...new function. (pass_ccp): Replace declaration with that of... (make_pass_ccp): ...new function. (pass_phi_only_cprop): Replace declaration with that of... (make_pass_phi_only_cprop): ...new function. (pass_build_ssa): Replace declaration with that of... (make_pass_build_ssa): ...new function. (pass_build_alias): Replace declaration with that of... (make_pass_build_alias): ...new function. (pass_build_ealias): Replace declaration with that of... (make_pass_build_ealias): ...new function. (pass_dominator): Replace declaration with that of... (make_pass_dominator): ...new function. (pass_dce): Replace declaration with that of... (make_pass_dce): ...new function. (pass_dce_loop): Replace declaration with that of... (make_pass_dce_loop): ...new function. (pass_cd_dce): Replace declaration with that of... (make_pass_cd_dce): ...new function. (pass_call_cdce): Replace declaration with that of... (make_pass_call_cdce): ...new function. (pass_merge_phi): Replace declaration with that of... (make_pass_merge_phi): ...new function. (pass_split_crit_edges): Replace declaration with that of... (make_pass_split_crit_edges): ...new function. (pass_pre): Replace declaration with that of... (make_pass_pre): ...new function. (pass_profile): Replace declaration with that of... (make_pass_profile): ...new function. (pass_strip_predict_hints): Replace declaration with that of... (make_pass_strip_predict_hints): ...new function. (pass_lower_complex_O0): Replace declaration with that of... (make_pass_lower_complex_O0): ...new function. (pass_lower_complex): Replace declaration with that of... (make_pass_lower_complex): ...new function. (pass_lower_vector): Replace declaration with that of... (make_pass_lower_vector): ...new function. (pass_lower_vector_ssa): Replace declaration with that of... (make_pass_lower_vector_ssa): ...new function. (pass_lower_omp): Replace declaration with that of... (make_pass_lower_omp): ...new function. (pass_diagnose_omp_blocks): Replace declaration with that of... (make_pass_diagnose_omp_blocks): ...new function. (pass_expand_omp): Replace declaration with that of... (make_pass_expand_omp): ...new function. (pass_expand_omp_ssa): Replace declaration with that of... (make_pass_expand_omp_ssa): ...new function. (pass_object_sizes): Replace declaration with that of... (make_pass_object_sizes): ...new function. (pass_strlen): Replace declaration with that of... (make_pass_strlen): ...new function. (pass_fold_builtins): Replace declaration with that of... (make_pass_fold_builtins): ...new function. (pass_stdarg): Replace declaration with that of... (make_pass_stdarg): ...new function. (pass_early_warn_uninitialized): Replace declaration with that of... (make_pass_early_warn_uninitialized): ...new function. (pass_late_warn_uninitialized): Replace declaration with that of... (make_pass_late_warn_uninitialized): ...new function. (pass_cse_reciprocals): Replace declaration with that of... (make_pass_cse_reciprocals): ...new function. (pass_cse_sincos): Replace declaration with that of... (make_pass_cse_sincos): ...new function. (pass_optimize_bswap): Replace declaration with that of... (make_pass_optimize_bswap): ...new function. (pass_optimize_widening_mul): Replace declaration with that of... (make_pass_optimize_widening_mul): ...new function. (pass_warn_function_return): Replace declaration with that of... (make_pass_warn_function_return): ...new function. (pass_warn_function_noreturn): Replace declaration with that of... (make_pass_warn_function_noreturn): ...new function. (pass_cselim): Replace declaration with that of... (make_pass_cselim): ...new function. (pass_phiopt): Replace declaration with that of... (make_pass_phiopt): ...new function. (pass_forwprop): Replace declaration with that of... (make_pass_forwprop): ...new function. (pass_phiprop): Replace declaration with that of... (make_pass_phiprop): ...new function. (pass_tree_ifcombine): Replace declaration with that of... (make_pass_tree_ifcombine): ...new function. (pass_dse): Replace declaration with that of... (make_pass_dse): ...new function. (pass_nrv): Replace declaration with that of... (make_pass_nrv): ...new function. (pass_rename_ssa_copies): Replace declaration with that of... (make_pass_rename_ssa_copies): ...new function. (pass_sink_code): Replace declaration with that of... (make_pass_sink_code): ...new function. (pass_fre): Replace declaration with that of... (make_pass_fre): ...new function. (pass_check_data_deps): Replace declaration with that of... (make_pass_check_data_deps): ...new function. (pass_copy_prop): Replace declaration with that of... (make_pass_copy_prop): ...new function. (pass_vrp): Replace declaration with that of... (make_pass_vrp): ...new function. (pass_uncprop): Replace declaration with that of... (make_pass_uncprop): ...new function. (pass_return_slot): Replace declaration with that of... (make_pass_return_slot): ...new function. (pass_reassoc): Replace declaration with that of... (make_pass_reassoc): ...new function. (pass_rebuild_cgraph_edges): Replace declaration with that of... (make_pass_rebuild_cgraph_edges): ...new function. (pass_remove_cgraph_callee_edges): Replace declaration with that of... (make_pass_remove_cgraph_callee_edges): ...new function. (pass_build_cgraph_edges): Replace declaration with that of... (make_pass_build_cgraph_edges): ...new function. (pass_local_pure_const): Replace declaration with that of... (make_pass_local_pure_const): ...new function. (pass_tracer): Replace declaration with that of... (make_pass_tracer): ...new function. (pass_warn_unused_result): Replace declaration with that of... (make_pass_warn_unused_result): ...new function. (pass_diagnose_tm_blocks): Replace declaration with that of... (make_pass_diagnose_tm_blocks): ...new function. (pass_lower_tm): Replace declaration with that of... (make_pass_lower_tm): ...new function. (pass_tm_init): Replace declaration with that of... (make_pass_tm_init): ...new function. (pass_tm_mark): Replace declaration with that of... (make_pass_tm_mark): ...new function. (pass_tm_memopt): Replace declaration with that of... (make_pass_tm_memopt): ...new function. (pass_tm_edges): Replace declaration with that of... (make_pass_tm_edges): ...new function. (pass_split_functions): Replace declaration with that of... (make_pass_split_functions): ...new function. (pass_feedback_split_functions): Replace declaration with that of... (make_pass_feedback_split_functions): ...new function. (pass_strength_reduction): Replace declaration with that of... (make_pass_strength_reduction): ...new function. (pass_ipa_lower_emutls): Replace declaration with that of... (make_pass_ipa_lower_emutls): ...new function. (pass_ipa_function_and_variable_visibility): Replace declaration with that of... (make_pass_ipa_function_and_variable_visibility): ...new function. (pass_ipa_tree_profile): Replace declaration with that of... (make_pass_ipa_tree_profile): ...new function. (pass_early_local_passes): Replace declaration with that of... (make_pass_early_local_passes): ...new function. (pass_ipa_whole_program_visibility): Replace declaration with that of... (make_pass_ipa_whole_program_visibility): ...new function. (pass_ipa_lto_gimple_out): Replace declaration with that of... (make_pass_ipa_lto_gimple_out): ...new function. (pass_ipa_increase_alignment): Replace declaration with that of... (make_pass_ipa_increase_alignment): ...new function. (pass_ipa_inline): Replace declaration with that of... (make_pass_ipa_inline): ...new function. (pass_ipa_free_lang_data): Replace declaration with that of... (make_pass_ipa_free_lang_data): ...new function. (pass_ipa_free_inline_summary): Replace declaration with that of... (make_pass_ipa_free_inline_summary): ...new function. (pass_ipa_cp): Replace declaration with that of... (make_pass_ipa_cp): ...new function. (pass_ipa_reference): Replace declaration with that of... (make_pass_ipa_reference): ...new function. (pass_ipa_pure_const): Replace declaration with that of... (make_pass_ipa_pure_const): ...new function. (pass_ipa_pta): Replace declaration with that of... (make_pass_ipa_pta): ...new function. (pass_ipa_lto_finish_out): Replace declaration with that of... (make_pass_ipa_lto_finish_out): ...new function. (pass_ipa_tm): Replace declaration with that of... (make_pass_ipa_tm): ...new function. (pass_ipa_profile): Replace declaration with that of... (make_pass_ipa_profile): ...new function. (pass_ipa_cdtor_merge): Replace declaration with that of... (make_pass_ipa_cdtor_merge): ...new function. (pass_cleanup_cfg_post_optimizing): Replace declaration with that of... (make_pass_cleanup_cfg_post_optimizing): ...new function. (pass_init_datastructures): Replace declaration with that of... (make_pass_init_datastructures): ...new function. (pass_fixup_cfg): Replace declaration with that of... (make_pass_fixup_cfg): ...new function. (pass_expand): Replace declaration with that of... (make_pass_expand): ...new function. (pass_instantiate_virtual_regs): Replace declaration with that of... (make_pass_instantiate_virtual_regs): ...new function. (pass_rtl_fwprop): Replace declaration with that of... (make_pass_rtl_fwprop): ...new function. (pass_rtl_fwprop_addr): Replace declaration with that of... (make_pass_rtl_fwprop_addr): ...new function. (pass_jump): Replace declaration with that of... (make_pass_jump): ...new function. (pass_jump2): Replace declaration with that of... (make_pass_jump2): ...new function. (pass_lower_subreg): Replace declaration with that of... (make_pass_lower_subreg): ...new function. (pass_cse): Replace declaration with that of... (make_pass_cse): ...new function. (pass_fast_rtl_dce): Replace declaration with that of... (make_pass_fast_rtl_dce): ...new function. (pass_ud_rtl_dce): Replace declaration with that of... (make_pass_ud_rtl_dce): ...new function. (pass_rtl_dce): Replace declaration with that of... (make_pass_rtl_dce): ...new function. (pass_rtl_dse1): Replace declaration with that of... (make_pass_rtl_dse1): ...new function. (pass_rtl_dse2): Replace declaration with that of... (make_pass_rtl_dse2): ...new function. (pass_rtl_dse3): Replace declaration with that of... (make_pass_rtl_dse3): ...new function. (pass_rtl_cprop): Replace declaration with that of... (make_pass_rtl_cprop): ...new function. (pass_rtl_pre): Replace declaration with that of... (make_pass_rtl_pre): ...new function. (pass_rtl_hoist): Replace declaration with that of... (make_pass_rtl_hoist): ...new function. (pass_rtl_store_motion): Replace declaration with that of... (make_pass_rtl_store_motion): ...new function. (pass_cse_after_global_opts): Replace declaration with that of... (make_pass_cse_after_global_opts): ...new function. (pass_rtl_ifcvt): Replace declaration with that of... (make_pass_rtl_ifcvt): ...new function. (pass_into_cfg_layout_mode): Replace declaration with that of... (make_pass_into_cfg_layout_mode): ...new function. (pass_outof_cfg_layout_mode): Replace declaration with that of... (make_pass_outof_cfg_layout_mode): ...new function. (pass_loop2): Replace declaration with that of... (make_pass_loop2): ...new function. (pass_rtl_loop_init): Replace declaration with that of... (make_pass_rtl_loop_init): ...new function. (pass_rtl_move_loop_invariants): Replace declaration with that of... (make_pass_rtl_move_loop_invariants): ...new function. (pass_rtl_unswitch): Replace declaration with that of... (make_pass_rtl_unswitch): ...new function. (pass_rtl_unroll_and_peel_loops): Replace declaration with that of... (make_pass_rtl_unroll_and_peel_loops): ...new function. (pass_rtl_doloop): Replace declaration with that of... (make_pass_rtl_doloop): ...new function. (pass_rtl_loop_done): Replace declaration with that of... (make_pass_rtl_loop_done): ...new function. (pass_web): Replace declaration with that of... (make_pass_web): ...new function. (pass_cse2): Replace declaration with that of... (make_pass_cse2): ...new function. (pass_df_initialize_opt): Replace declaration with that of... (make_pass_df_initialize_opt): ...new function. (pass_df_initialize_no_opt): Replace declaration with that of... (make_pass_df_initialize_no_opt): ...new function. (pass_reginfo_init): Replace declaration with that of... (make_pass_reginfo_init): ...new function. (pass_inc_dec): Replace declaration with that of... (make_pass_inc_dec): ...new function. (pass_stack_ptr_mod): Replace declaration with that of... (make_pass_stack_ptr_mod): ...new function. (pass_initialize_regs): Replace declaration with that of... (make_pass_initialize_regs): ...new function. (pass_combine): Replace declaration with that of... (make_pass_combine): ...new function. (pass_if_after_combine): Replace declaration with that of... (make_pass_if_after_combine): ...new function. (pass_ree): Replace declaration with that of... (make_pass_ree): ...new function. (pass_partition_blocks): Replace declaration with that of... (make_pass_partition_blocks): ...new function. (pass_match_asm_constraints): Replace declaration with that of... (make_pass_match_asm_constraints): ...new function. (pass_regmove): Replace declaration with that of... (make_pass_regmove): ...new function. (pass_split_all_insns): Replace declaration with that of... (make_pass_split_all_insns): ...new function. (pass_fast_rtl_byte_dce): Replace declaration with that of... (make_pass_fast_rtl_byte_dce): ...new function. (pass_lower_subreg2): Replace declaration with that of... (make_pass_lower_subreg2): ...new function. (pass_mode_switching): Replace declaration with that of... (make_pass_mode_switching): ...new function. (pass_sms): Replace declaration with that of... (make_pass_sms): ...new function. (pass_sched): Replace declaration with that of... (make_pass_sched): ...new function. (pass_ira): Replace declaration with that of... (make_pass_ira): ...new function. (pass_reload): Replace declaration with that of... (make_pass_reload): ...new function. (pass_clean_state): Replace declaration with that of... (make_pass_clean_state): ...new function. (pass_branch_prob): Replace declaration with that of... (make_pass_branch_prob): ...new function. (pass_value_profile_transformations): Replace declaration with that of... (make_pass_value_profile_transformations): ...new function. (pass_postreload_cse): Replace declaration with that of... (make_pass_postreload_cse): ...new function. (pass_gcse2): Replace declaration with that of... (make_pass_gcse2): ...new function. (pass_split_after_reload): Replace declaration with that of... (make_pass_split_after_reload): ...new function. (pass_branch_target_load_optimize1): Replace declaration with that of... (make_pass_branch_target_load_optimize1): ...new function. (pass_thread_prologue_and_epilogue): Replace declaration with that of... (make_pass_thread_prologue_and_epilogue): ...new function. (pass_stack_adjustments): Replace declaration with that of... (make_pass_stack_adjustments): ...new function. (pass_peephole2): Replace declaration with that of... (make_pass_peephole2): ...new function. (pass_if_after_reload): Replace declaration with that of... (make_pass_if_after_reload): ...new function. (pass_regrename): Replace declaration with that of... (make_pass_regrename): ...new function. (pass_cprop_hardreg): Replace declaration with that of... (make_pass_cprop_hardreg): ...new function. (pass_reorder_blocks): Replace declaration with that of... (make_pass_reorder_blocks): ...new function. (pass_branch_target_load_optimize2): Replace declaration with that of... (make_pass_branch_target_load_optimize2): ...new function. (pass_leaf_regs): Replace declaration with that of... (make_pass_leaf_regs): ...new function. (pass_split_before_sched2): Replace declaration with that of... (make_pass_split_before_sched2): ...new function. (pass_compare_elim_after_reload): Replace declaration with that of... (make_pass_compare_elim_after_reload): ...new function. (pass_sched2): Replace declaration with that of... (make_pass_sched2): ...new function. (pass_stack_regs): Replace declaration with that of... (make_pass_stack_regs): ...new function. (pass_stack_regs_run): Replace declaration with that of... (make_pass_stack_regs_run): ...new function. (pass_df_finish): Replace declaration with that of... (make_pass_df_finish): ...new function. (pass_compute_alignments): Replace declaration with that of... (make_pass_compute_alignments): ...new function. (pass_duplicate_computed_gotos): Replace declaration with that of... (make_pass_duplicate_computed_gotos): ...new function. (pass_variable_tracking): Replace declaration with that of... (make_pass_variable_tracking): ...new function. (pass_free_cfg): Replace declaration with that of... (make_pass_free_cfg): ...new function. (pass_machine_reorg): Replace declaration with that of... (make_pass_machine_reorg): ...new function. (pass_cleanup_barriers): Replace declaration with that of... (make_pass_cleanup_barriers): ...new function. (pass_delay_slots): Replace declaration with that of... (make_pass_delay_slots): ...new function. (pass_split_for_shorten_branches): Replace declaration with that of... (make_pass_split_for_shorten_branches): ...new function. (pass_split_before_regstack): Replace declaration with that of... (make_pass_split_before_regstack): ...new function. (pass_convert_to_eh_region_ranges): Replace declaration with that of... (make_pass_convert_to_eh_region_ranges): ...new function. (pass_shorten_branches): Replace declaration with that of... (make_pass_shorten_branches): ...new function. (pass_set_nothrow_function_flags): Replace declaration with that of... (make_pass_set_nothrow_function_flags): ...new function. (pass_dwarf2_frame): Replace declaration with that of... (make_pass_dwarf2_frame): ...new function. (pass_final): Replace declaration with that of... (make_pass_final): ...new function. (pass_rtl_seqabstr): Replace declaration with that of... (make_pass_rtl_seqabstr): ...new function. (pass_release_ssa_names): Replace declaration with that of... (make_pass_release_ssa_names): ...new function. (pass_early_inline): Replace declaration with that of... (make_pass_early_inline): ...new function. (pass_inline_parameters): Replace declaration with that of... (make_pass_inline_parameters): ...new function. (pass_update_address_taken): Replace declaration with that of... (make_pass_update_address_taken): ...new function. (pass_convert_switch): Replace declaration with that of... (make_pass_convert_switch): ...new function. * tree-profile.c (pass_ipa_tree_profile): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_tree_profile): ...new pass_data instance and... (make_pass_ipa_tree_profile): ...new function. * tree-sra.c (pass_sra_early): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_sra_early): ...new pass_data instance and... (make_pass_sra_early): ...new function. (pass_sra): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_sra): ...new pass_data instance and... (make_pass_sra): ...new function. (pass_early_ipa_sra): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_early_ipa_sra): ...new pass_data instance and... (make_pass_early_ipa_sra): ...new function. * tree-ssa-ccp.c (pass_ccp): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_ccp): ...new pass_data instance and... (make_pass_ccp): ...new function. (pass_fold_builtins): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_fold_builtins): ...new pass_data instance and... (make_pass_fold_builtins): ...new function. * tree-ssa-copy.c (pass_copy_prop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_copy_prop): ...new pass_data instance and... (make_pass_copy_prop): ...new function. * tree-ssa-copyrename.c (pass_rename_ssa_copies): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_rename_ssa_copies): ...new pass_data instance and... (make_pass_rename_ssa_copies): ...new function. * tree-ssa-dce.c (pass_dce): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_dce): ...new pass_data instance and... (make_pass_dce): ...new function. (pass_dce_loop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_dce_loop): ...new pass_data instance and... (make_pass_dce_loop): ...new function. (pass_cd_dce): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_cd_dce): ...new pass_data instance and... (make_pass_cd_dce): ...new function. * tree-ssa-dom.c (pass_dominator): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_dominator): ...new pass_data instance and... (make_pass_dominator): ...new function. (pass_phi_only_cprop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_phi_only_cprop): ...new pass_data instance and... (make_pass_phi_only_cprop): ...new function. * tree-ssa-dse.c (pass_dse): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_dse): ...new pass_data instance and... (make_pass_dse): ...new function. * tree-ssa-forwprop.c (pass_forwprop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_forwprop): ...new pass_data instance and... (make_pass_forwprop): ...new function. * tree-ssa-ifcombine.c (pass_tree_ifcombine): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tree_ifcombine): ...new pass_data instance and... (make_pass_tree_ifcombine): ...new function. * tree-ssa-loop-ch.c (pass_ch): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_ch): ...new pass_data instance and... (make_pass_ch): ...new function. * tree-ssa-loop.c (pass_tree_loop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tree_loop): ...new pass_data instance and... (make_pass_tree_loop): ...new function. (pass_tree_loop_init): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tree_loop_init): ...new pass_data instance and... (make_pass_tree_loop_init): ...new function. (pass_lim): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lim): ...new pass_data instance and... (make_pass_lim): ...new function. (pass_tree_unswitch): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tree_unswitch): ...new pass_data instance and... (make_pass_tree_unswitch): ...new function. (pass_predcom): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_predcom): ...new pass_data instance and... (make_pass_predcom): ...new function. (pass_vectorize): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_vectorize): ...new pass_data instance and... (make_pass_vectorize): ...new function. (pass_graphite): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_graphite): ...new pass_data instance and... (make_pass_graphite): ...new function. (pass_graphite_transforms): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_graphite_transforms): ...new pass_data instance and... (make_pass_graphite_transforms): ...new function. (pass_check_data_deps): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_check_data_deps): ...new pass_data instance and... (make_pass_check_data_deps): ...new function. (pass_iv_canon): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_iv_canon): ...new pass_data instance and... (make_pass_iv_canon): ...new function. (pass_scev_cprop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_scev_cprop): ...new pass_data instance and... (make_pass_scev_cprop): ...new function. (pass_record_bounds): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_record_bounds): ...new pass_data instance and... (make_pass_record_bounds): ...new function. (pass_complete_unroll): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_complete_unroll): ...new pass_data instance and... (make_pass_complete_unroll): ...new function. (pass_complete_unrolli): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_complete_unrolli): ...new pass_data instance and... (make_pass_complete_unrolli): ...new function. (pass_parallelize_loops): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_parallelize_loops): ...new pass_data instance and... (make_pass_parallelize_loops): ...new function. (pass_loop_prefetch): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_loop_prefetch): ...new pass_data instance and... (make_pass_loop_prefetch): ...new function. (pass_iv_optimize): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_iv_optimize): ...new pass_data instance and... (make_pass_iv_optimize): ...new function. (pass_tree_loop_done): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tree_loop_done): ...new pass_data instance and... (make_pass_tree_loop_done): ...new function. * tree-ssa-math-opts.c (pass_cse_reciprocals): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_cse_reciprocals): ...new pass_data instance and... (make_pass_cse_reciprocals): ...new function. (pass_cse_sincos): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_cse_sincos): ...new pass_data instance and... (make_pass_cse_sincos): ...new function. (pass_optimize_bswap): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_optimize_bswap): ...new pass_data instance and... (make_pass_optimize_bswap): ...new function. (pass_optimize_widening_mul): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_optimize_widening_mul): ...new pass_data instance and... (make_pass_optimize_widening_mul): ...new function. * tree-ssa-phiopt.c (pass_phiopt): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_phiopt): ...new pass_data instance and... (make_pass_phiopt): ...new function. (pass_cselim): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_cselim): ...new pass_data instance and... (make_pass_cselim): ...new function. * tree-ssa-phiprop.c (pass_phiprop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_phiprop): ...new pass_data instance and... (make_pass_phiprop): ...new function. * tree-ssa-pre.c (pass_pre): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_pre): ...new pass_data instance and... (make_pass_pre): ...new function. (pass_fre): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_fre): ...new pass_data instance and... (make_pass_fre): ...new function. * tree-ssa-reassoc.c (pass_reassoc): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_reassoc): ...new pass_data instance and... (make_pass_reassoc): ...new function. * tree-ssa-sink.c (pass_sink_code): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_sink_code): ...new pass_data instance and... (make_pass_sink_code): ...new function. * tree-ssa-strlen.c (pass_strlen): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_strlen): ...new pass_data instance and... (make_pass_strlen): ...new function. * tree-ssa-structalias.c (pass_build_alias): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_build_alias): ...new pass_data instance and... (make_pass_build_alias): ...new function. (pass_build_ealias): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_build_ealias): ...new pass_data instance and... (make_pass_build_ealias): ...new function. (pass_ipa_pta): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_pta): ...new pass_data instance and... (make_pass_ipa_pta): ...new function. * tree-ssa-uncprop.c (pass_uncprop): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_uncprop): ...new pass_data instance and... (make_pass_uncprop): ...new function. * tree-ssa-uninit.c (pass_late_warn_uninitialized): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_late_warn_uninitialized): ...new pass_data instance and... (make_pass_late_warn_uninitialized): ...new function. * tree-ssa.c (pass_init_datastructures): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_init_datastructures): ...new pass_data instance and... (make_pass_init_datastructures): ...new function. (pass_early_warn_uninitialized): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_early_warn_uninitialized): ...new pass_data instance and... (make_pass_early_warn_uninitialized): ...new function. (pass_update_address_taken): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_update_address_taken): ...new pass_data instance and... (make_pass_update_address_taken): ...new function. * tree-ssanames.c (pass_release_ssa_names): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_release_ssa_names): ...new pass_data instance and... (make_pass_release_ssa_names): ...new function. * tree-stdarg.c (pass_stdarg): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_stdarg): ...new pass_data instance and... (make_pass_stdarg): ...new function. * tree-switch-conversion.c (pass_convert_switch): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_convert_switch): ...new pass_data instance and... (make_pass_convert_switch): ...new function. * tree-tailcall.c (pass_tail_recursion): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tail_recursion): ...new pass_data instance and... (make_pass_tail_recursion): ...new function. (pass_tail_calls): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tail_calls): ...new pass_data instance and... (make_pass_tail_calls): ...new function. * tree-vect-generic.c (pass_lower_vector): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_vector): ...new pass_data instance and... (make_pass_lower_vector): ...new function. (pass_lower_vector_ssa): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_lower_vector_ssa): ...new pass_data instance and... (make_pass_lower_vector_ssa): ...new function. * tree-vectorizer.c (pass_slp_vectorize): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_slp_vectorize): ...new pass_data instance and... (make_pass_slp_vectorize): ...new function. (pass_ipa_increase_alignment): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_increase_alignment): ...new pass_data instance and... (make_pass_ipa_increase_alignment): ...new function. * tree-vrp.c (pass_vrp): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_vrp): ...new pass_data instance and... (make_pass_vrp): ...new function. * tree.c (pass_ipa_free_lang_data): Convert from a global struct to a subclass of simple_ipa_opt_pass along with... (pass_data_ipa_free_lang_data): ...new pass_data instance and... (make_pass_ipa_free_lang_data): ...new function. * tsan.c (pass_tsan): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tsan): ...new pass_data instance and... (make_pass_tsan): ...new function. (pass_tsan_O0): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_tsan_O0): ...new pass_data instance and... (make_pass_tsan_O0): ...new function. * var-tracking.c (pass_variable_tracking): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_variable_tracking): ...new pass_data instance and... (make_pass_variable_tracking): ...new function. * web.c (pass_web): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_web): ...new pass_data instance and... (make_pass_web): ...new function. * config/epiphany/epiphany.h (pass_mode_switch_use): Replace declaration with that of... (make_pass_mode_switch_use): ...new function. (pass_resolve_sw_modes): Replace declaration with that of... (make_pass_resolve_sw_modes): ...new function. * config/epiphany/mode-switch-use.c (pass_mode_switch_use): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_mode_switch_use): ...new pass_data instance and... (make_pass_mode_switch_use): ...new function. * config/epiphany/resolve-sw-modes.c (pass_resolve_sw_modes): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_resolve_sw_modes): ...new pass_data instance and... (make_pass_resolve_sw_modes): ...new function. * config/i386/i386.c (pass_insert_vzeroupper): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_insert_vzeroupper): ...new pass_data instance and... (make_pass_insert_vzeroupper): ...new function. * config/sparc/sparc.c (pass_work_around_errata): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_work_around_errata): ...new pass_data instance and... (make_pass_work_around_errata): ...new function. * config/mips/mips.c (pass_mips_machine_reorg2): Convert from a global struct to a subclass of rtl_opt_pass along with... (pass_data_mips_machine_reorg2): ...new pass_data instance and... (make_pass_mips_machine_reorg2): ...new function. gcc/testsuite/ Patch autogenerated by refactor_passes.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 03fe39476a4c4ea450b49e087cfa817b5f92021e * gcc.dg/plugin/one_time_plugin.c (one_pass): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_one_pass): ...new pass_data instance and... (make_one_pass): ...new function. * gcc.dg/plugin/selfassign.c (pass_warn_self_assign): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_warn_self_assign): ...new pass_data instance and... (make_pass_warn_self_assign): ...new function. * g++.dg/plugin/dumb_plugin.c (pass_dumb_plugin_example): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_dumb_plugin_example): ...new pass_data instance and... (make_pass_dumb_plugin_example): ...new function. * g++.dg/plugin/selfassign.c (pass_warn_self_assign): Convert from a global struct to a subclass of gimple_opt_pass along with... (pass_data_warn_self_assign): ...new pass_data instance and... (make_pass_warn_self_assign): ...new function. From-SVN: r201508
2013-08-05 22:16:05 +02:00
gimple_opt_pass *
make_pass_strength_reduction (gcc::context *ctxt)
{
return new pass_strength_reduction (ctxt);
}